Managing CPI Communications Events in a Virtual Machine
Your program can call the Wait_on_Event (XCWOE) routine to wait for communications from one or more partners. This routine allows your program to wait for and then take action according to the type of request it receives.
If your program needs to know about certain events that occur in its virtual machine, you can provide an interrupt handler that gets control when those events occur. The interrupt handler can then call Signal_User_Event (XCSUE) to queue the event, called a user event. This user event will be reported when your communications program issues Wait_on_Event (XCWOE).
See Scenario 4: Signaling a User Event for an example of how an application can use the Signal_User_Event routine. See the z/VM: CMS Application Development Guide for Assembler for information on writing interrupt handlers.
For multitasking applications, directly handle the VMCPIC event rather than using Wait_on_Event. A call to Wait_on_Event causes the entire application to wait, thus blocking the progress of all the threads. By using the thread-oriented Event Management Services to handle the VMCPIC event, the same conditions (except for request IDs and user events signalled by Signal_User_Event) can be handled, while requiring at most one thread to wait.