Java. util. concurrent package source code reading 18 Exchanger, java. util package
Exchanger can be seen as SynchronousQueue for two-way data transmission, that is, there is no distinction between producers and consumers, and any two threads can exchange data.
In JDK 5, the Exchanger is designed as a container with a capacity of 1 to store a waiting thread. Data Exchange will occur when another thread arrives, and the container is cleared until the next thread arrives.
Since JDK6, Exchanger uses a segmentation idea similar to ConcurrentMap and provides multiple slots to increase the throughput during concurrent execution.
There is no fair or unfair mode for Exchanger, because there is no queue, data exchange can happen as long as there are two threads.
The core method is as follows:
Private Object doExchange (Object item, boolean timed, long nanos) {Node me = new Node (item ); // index is the hash value of the thread ID mapped to a value between 0 and max // in general, max is 0, so that the thread will only use the first slot for data exchange, // If index is 0 and max is not 0, see the following loop int index = hashIndex (); // Number of CAS operation failures int fails = 0; for (;) {// The Object stored in the current slot, that is, Node Object y; Slot slot = arena [index]; // delayed loading, that is, a slot is created only when the slot is null. // The slot is recycled once after delayed loading. if (slot = null) createSlot (index ); // The slot contains data, which means that a thread is waiting for data exchange. // at this time, you can try to reset the slot with CAS (set the slot object to null) // use the objects stored in the slot to exchange data with the current thread // if the exchange is successful, the original waiting thread else if (y = slot. get ())! = Null & slot. compareAndSet (y, null) {Node you = (Node) y; if (you. compareAndSet (null, item) {LockSupport. unpark (you. waiter); return you. item;} // If the slot object has been reset to null, however, the data exchange fails. // This means that the exchange request of the waiting thread has been canceled. // you will see how to handle this problem when analyzing the wait method code.} // If no objects are stored in the slot, first, try to store the current thread in the slot. // if the storage fails, reloop else if (y = null & slot. compareAndSet (null, me) {// The value of index 0 indicates that only the current thread is waiting for data exchange, so you can wait directly if (index = 0) Return timed? AwaitNanos (me, slot, nanos): await (me, slot); // the so-called spin wait: a fixed number of cycles, reducing each count by one // for Single-core systems, spin wait does not do this because CPU usage is required for Single-core/wait and other threads cannot use the CPU. Therefore, such a // wait is meaningless. In a multi-core system, the spin value is 2000, that is, 2000 cycles are performed. // If no data is exchanged after the loop is completed, a // CANCEL object is returned, indicating that the request is still canceled, and clear the Node from the slot Object v = spinWait (me, slot); if (v! = CANCEL) return v; // if canceled, create a new Node to CANCEL the previously canceled Node for the next loop me = new Node (item); int m = max. get (); // remove 2 from index to narrow the slot range. // if m is too large, reduce m if (m> (index >>> = 1) max. compareAndSet (m, m-1);} // allow CAS to fail twice, because both else if have CAS, therefore, here // The CAS operation that allows two else if operations fail over else if (++ fails> 1) {int m = max. get (); // failed more than 3 times, increase m, and re-index if (fails> 3 & m <FULL & max. compareAndSet (m, m + 1) index = m + 1; // when the index is smaller than 0, return to m and reloop else if (-- index <0) index = m ;}}}
This article is not very clear about the index. We will continue to study and update the index in a timely manner.
Help translate
8. Conclusion
An iterative control chart has been proposed to improve the outlet temperature control of the heat exchanger by calculating the resonance. With the repeated controller, a closed-loop Response with good attenuation may be obtained, and it is impossible for the Controller to design a simple PI controller based on the system's open-loop step-by-step response.
The main argument in this article is that resonance at a known frequency can be interpreted and modeled as a disturbance. It can be compensated by a simplified low-level system model including resonance, the model parameters have physical meanings and are directly extended to different frequencies for resonance, and the application of the expected control diagrams for different types of heat exchangers. The comments in this article compare the benefits of the gradual approximation of ring type or modeling.
In addition, in the case discussed in this article, the resonance model comes from the physical nature of the system, but the author believes that the related concepts can be used to eliminate the resonance effect of other typical systems.
Although the repetitive control chart can reduce the resonance force caused by the control signal vibration, it emphasizes the need for fast and precise actuators. If the actuator cannot reproduce the control signal, the resonance force cannot be completely eliminated.
This article also covers the extended application of the controller, that is, when the outlet temperature is controlled by the fluid viscosity, the controller is used to process the system with a change in the resonance frequency. Physically, resonance is identified by the suspension time of the fluid pipeline. Therefore, the resonance frequency can be estimated only when the actuator transmits the first control signal to the system.
This leads to an error that increases with the duration of the controller.
The complex nonlinear model has been used to test the Repetitive Controller and Its robustness of non-modulus is analyzed. The model used is the ACUREX solar heat exchanger, which is based on the physical average and is incrementally adjusted to calculate different hold times. Estimate the hold time and add the variable frequency controller to the device system for better control.
References: No Machine Translation
ASTM A269, the American Standard for stainless steel pipes
There is no direct and complete standard. The two systems are different.
You may refer to the following standards:
1. GB 3087-1999
Seamless steel tubes for low and medium pressure
Seamless Steel Pipes for low and medium pressure boilers
2. GB 3087-2008
Seamless steel tubes for low and medium pressure boiler
Seamless Steel Pipes for low and medium pressure boilers
3. GB/T 3089-2008
Thinnest-wall seamless tubes of stainless steel
Stainless steel extremely thin-walled seamless steel pipe
4. GB/T 3090-2000
Stainless steel small diameter seamless steel tubes
Stainless Steel Small Diameter seamless steel pipe
5. GB/T 3093-2002
High-pressure seamless steel tubes for diesel engine
High-pressure seamless steel pipe for diesel engines
6. GB/T 3639-2000
Cold-drawn or cold-rolled precision seamless steel tubes
Cold Drawn or cold-rolled precision seamless steel pipe
7. GB 5310-1995
Seamless steel tubes and pipes for high pressure boiler
High pressure cooker seamless steel pipe
8. GB 5310-2008
Seamless steel tubes and pipes for high pressure boiler
High pressure cooker seamless steel pipe
9. GB/T 5312-1999
Carbon and carbon -- Manganese steel seamless steel tubes and pipes for ship
Seamless Steel Pipe for carbon steel and Carbon manganese steel for Ships
11. GB 6479-2000
Seamless steel tubes for high-pressure chemical fertilizer equipments
Seamless Steel Pipe for High-Pressure fertilizer Equipment
12. GB/T 8162-2008
Seamless steel tubes for structural purposes
Seamless Steel Pipe for Structure
13. GB/T 8163-2008
Seamless steel tubes for liquid service
Seamless Steel Pipe for fluid Transportation
14. GB/T 9711.3-2005
Petroleum and natural gas industries-Steel pipe for pipelines-Technical delivery conditiions-Part 3: Pipes of requirements class C
Technical conditions for delivery of steel pipes for Oil and Gas Industry-Part 1: Class C steel pipes
15. GB/T 9808-2008
Seamless steel tubes for drilling
Seamless Steel Pipe for Drilling
16. GB 9948-2006
Seamless steel tubes for petroleum cracking
Seamless Steel Pipe for petroleum cracking
17. GB 13296-2007
Seamless stainl ...... remaining full text>