Using Synchronous Functions
When you issue a synchronous APPC/VM function (by specifying WAIT=YES on the APPCVM macro), your virtual machine goes into a WAIT state. This means you cannot issue any APPC/VM functions to any paths until the synchronous function that you issued completes. You can, however, enter the CP commands IPL, LOGOFF, SYSTEM RESET, and SYSTEM CLEAR to terminate the wait state.
When a synchronous APPC/VM function completes you do not get an interrupt to tell you about the completion; instead, the function complete data goes to the output parameter list for the function.
- Your partner issues a function to complete your function
- Your partner logs off or resets its virtual machine
- You log off or reset your virtual machine
- Your partner completes work unit processing for APPC/VM conversations established using CMSIUCV CONNECT or CMSIUCV ACCEPT
- You complete work unit processing for APPC/VM conversations established using CMSIUCV CONNECT or CMSIUCV ACCEPT.
Synchronous functions are not affected by interrupts of any kind. Even if your virtual machine is enabled for interrupts, you are not given control until your function completes.
Use synchronous functions carefully! If your communications partner does not respond, log off, or do a system reset, your virtual machine cannot execute any instruction until you IPL, log off, reset, or clear your virtual machine. Applications should take responsibility to avoid deadlock situations. A deadlock situation is when two virtual machines are waiting for an action or response from each other. Do not use the synchronous option for a program that must serve more than one user at the same time, or for a program that must run in a multitasking environment within a virtual machine.
- When the APPC/VM function does not complete immediately, your virtual machine must wait before issuing other APPC/VM functions on the path; however, you can issue APPC/VM functions to other paths while waiting for the asynchronous function to complete. You get an interrupt when the function does complete.
- When an asynchronous APPC/VM function does complete immediately, you do not receive a function complete interrupt; however, you get the function complete data in the output parameter list.
Your communications partner sees no difference if you issue APPC/VM functions synchronously (WAIT=YES) or asynchronously (WAIT=NO).