Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Access to shared storage areas in a concurrent server program z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference SC27-3660-00 |
|
If two tasks access the same storage area, you need full control over the use of the storage area unless the storage is read-only. If the storage area is used to pass parameters between the tasks, you must serialize access to the shared resource (the storage area). In an MVS™ environment, you can use MVS latching services or traditional enqueue and dequeue system calls to access the shared resource. For MVS latching services, use the ISGLOBT and ISGLREL callable services. In assembler, use the ENQ and DEQ macros for enqueue and dequeue functions. Figure 1 illustrates access to a shared storage area. Figure 1. Serialized
access to a shared storage area
The following steps describe this process.
There are situations in which this assumption does not
suffice. If you use a storage area to pass parameters to some kind
of service task inside your address space, you must ensure that the
service task has read the information and acted on it before another
task in your address space tries to pass information to the service
task using the same storage area, like running a log or trace. This
is illustrated in Figure 2.
Figure 2. Synchronized use of a common service
task
Follow these steps to synchronize a common service task:
This technique is relatively simple. It can be made more complicated, and more efficient, by using internal request queues so the requesting task does not need to wait for the service task to complete the active request. When you use the enqueue system call, you have the option to test whether a resource is available. In some situations, you might choose this to avoid the wait at a particular point in your processing, so you can divert to some other actions when the resource is not available. |
Copyright IBM Corporation 1990, 2014
|