z/OS MVS Programming: Extended Addressability Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Proper serialization of shared memory objects

z/OS MVS Programming: Extended Addressability Guide
SA23-1394-00

It is important to serialize access to shared memory objects so that the shared memory objects your program creates and uses do not cause situations where z/OS® finds reason to abnormally end the work unit. Shared memory objects can be serialized with ENQs, Latches, or other cross-address space serialization techniques.

The following example shows the behavior of memory objects when strict serialization is not maintained.

Example: Tasks A, B, and C are sharing storage through a GETSHARED request obtained by task A. Task B and C are continually sharing the storage via SHAREMEMOBJ and DETACH AFFINITY=LOCAL. They continue sharing until task A chooses to DETACH AFFINITY=SYSTEM to the shared storage while both of the following conditions apply:
  • Task B still holds an interest in the storage and
  • Task C no longer has a local interest in the shared storage (issued DETACH AFFINITY=LOCAL).
If work unit C tries to share the memory object again (through SHAREMEMOBJ), the system will issue an abend code DC2 with reason code xx0040xx because it was not serialized against the DETACH AFFINITY=SYSTEM issued by work unit A.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014