CPU serialization
An I-stream engine processes instructions one at a time. The processing of one instruction precedes the processing of the following instruction in the order in which the instructions appear in storage. This is called the conceptual sequence. Moreover, interruptions can take place between and within instructions.
During actual operation, instructions are broken down into smaller units. Their processing consists of a series of discrete steps. Depending on the instruction, operands can be fetched and processed in a piecemeal fashion, and some delay can occur between the fetching of operands and the storing of results. Within a given I-stream engine, access to shared main storage may not be in the same sequence implied by the conceptual sequence. This is related to instruction prefetching and the way the z/Architecture® hardware overlaps storage references in the control of the special private buffers, called caches. A serialization operation consists of completing all conceptually previous shared main storage accesses by an I-stream engine, as observed by other I-stream engines and by channel programs, before proceeding with the conceptually subsequent main storage accesses. All interruptions and the execution of certain instructions cause a serialization of CPU operations.
The operations of a conceptual sequence of code can be out of synchronization with its caches. So, there can be some delay in placing results in the shared main storage. The delay has no time limit and does not affect the sequence in which results are placed in storage. That is, the conceptual sequence is the actual sequence observed by other I-stream engines and the channel subsystem. However, the store instructions to shared main storage are completed only as a result of a serialization operation and before an I-stream engine enters the stopped state.
In a tightly coupled multiprocessing environment, operating system design makes sure that deadlock does not occur between I-stream engines. For instance, two or more I-stream engines may depend upon each other to issue a serialization operation to force an update of shared main storage. Fortunately, these details are handled by the software of the z/TPF system.
Keep in mind that the test and set instruction enables the system to enter the critical region for just one process. The test and set instruction is executed outside of the critical region, in multiple I-stream engines. Serialization is under the control of a single I-stream engine in contrast to the interlock instructions where two or more I-streams are called.