Chapter Contents |
Previous |
Next |
Inter-User Communications Vehicle (IUCV) Functions |
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.
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.
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.