How CRCR Processes Interlock

In order for information to be transferred through CRCR, the sending process and the receiving process must interlock. This interlocking is a temporary linkage established by the operating system. The system interlocks two processes if one is attempting a send operation, the other is attempting a receive operation, and the program name of each process matches that requested by the other process.

Once the interlock occurs, the system transfers the data from one process to the other and then removes the interlock. If the same two processes exchange information repeatedly, the system repeats the steps of matching the processes and establishing an interlock each time.

In practice, the two processes are unlikely to issue the send and receive requests at exactly the same moment. Therefore, the first of the two processes to submit its request enters a waiting state until the matching process submits the matching request. However, you can control which process does the waiting by making one of the two processes do a conditional send or receive request.

If you do not wish for a CRCR process to enter a waiting state, you can design the process to set the No Wait flag in the send or receive request. When you set this flag, the process abandons the send or receive operation and continues executing if the matching process is not ready to interlock.

Alternatively, you can design a CRCR process to execute a WAIT statement that waits on a list of events. The list of events can include the predeclared events CRCR_INPUT and CRCR_OUTPUT, which notify the process when a matching process submits a send or receive request. By looping repeatedly on such a complex wait statement, a process can handle both CRCR communications and a variety of other transactions as they occur.

The No Wait flag or the complex wait strategy should be used for only one of the two matching CRCR processes. One of the two CRCR processes must submit a simple send or receive request and enter a waiting state, or no interlock can ever occur.