Chapter Contents

Previous

Next
Inter-User Communications Vehicle (IUCV) Functions

IUCV, Signal Handling, and Message Processing

Inter-user communication is driven by asynchronous IUCV external interrupts. That is, IUCV requires synchronization and cooperation of communicating processes. As seen in the previous section, the library relies on IUCV and CMS support of IUCV to help coordinate these interrupts. However, programs initiate and handle IUCV interrupts in the context of SAS/C signal processing. All IUCV interrupts are identified by the asynchronous signal SIGIUCV. A program must first call signal or sigaction to establish a handler for SIGIUCV signals. Calling signal identifies a function (called a handler) that should be invoked when an IUCV interrupt occurs. The handler should call the signal function siginfo , which returns a pointer to a structure containing the external interrupt data.

Signal processing handles the IUCV interrupts associated with the basic IUCV tasks. IUCV external interrupts can be divided into those concerning connections and paths and those prompted by message transfer. The IUCV external interrupt types are summarized in the following table.

Connection and Path Interrupts Message Transfer Interrupts
Connection Pending Incoming priority message
Connection complete Incoming message nonpriority
Path severed Incoming priority reply
Path quiesced Priority reply
Path resumed

The library, at the time of the first call to signal with the SIGIUCV signal identifier, initializes all library handling of IUCV external interrupts for the program and associates a SIGIUCV handler with the external interrupt. Although iucvset can be called any number of times within a program to establish multiple message paths, only one SIGIUCV handler can be associated with IUCV signals at any one time. Of course, programs can redefine handlers in subsequent calls to signal , or a single handler can use the external interrupt type to route the signal to subsidiary functions. Because each message is uniquely identified, the SIGIUCV handler can use this data to route signals of similar types to other functions.

A simple example of the complete IUCV communication process is given in the following table. In this example, calls to the signal functions sigblock , sigpause , and siginfo are combined with SAS/C IUCV function calls to process a message sent from a source virtual machine to a receiving or target virtual machine. Note that before any message transfer can occur, a call must be made to signal to identify the handler for subsequent SIGIUCV interrupts. Note also that the call to signal must be paired with a call to iucvset to initialize communication (step 1). These calls must be made by both sender and receiver before any inter-user communication can take place. Subsequent calls are traced back and forth across the table. In step 2, for example, the receiving program issues a call to sigpause to wait for the sending program's interrupt. In step 3, the sender issues an iucvconn to attempt a connection with the receiver, and so on.

Sending Program Function Called Purpose of Call Receiving Program Function Called
1. signal sigblock iucvset Intialize communications signal sigblock iucvset

Wait for interrupt 2. sigpause
3. iucvconn Sender attempts to connect; receiver recognizes a connection pending 4. siginfo
5. sigpause Sender waits until receiver accepts connection 6. iucvacc
7. siginfo iucvsend sigpause Sender recognizes connection is complete, sends a message, and waits for the reply

Receiver recognizes an incoming message, receives it, replies, and waits 8. siginfo iucvrecv iucvrply sigpause
9. siginfo Sender recognizes an incoming reply and processes it
10. iucvsevr iucvclr Message transfer complete; sender severs path and clears; receiver recognizes path severed 11. siginfo

In this table, many of the IUCV function calls occur based on the information returned from the call to siginfo . This signal function returns a pointer to one of three external interrupt structures. The structure pointed to depends on the interrupt subtype. These structures and their parameters are easily accessible to the program. The next section discusses the structures involved in IUCV communication and the information available to the program.


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.