contentions, either in a LIFO or FIFO
manner. The lock/unlock functions can
then be used as the interlock mechanism
for updating an SRR of any complexity.
The lock/unlock functions are based on
the use of a"header" associated with
the SRR. The header is the common
starting point for determining the
states of the SRR, either free or in
use, and also is used for queuing
requests when contentions occur.Contentions are resolved using WAIT and POST. The general programming technique
requires that the program that encount
ers a"locked" SRR must "leave a mark on
thewall" indicating the address of an ECB on which it will WAIT. The "unlock ing" program sees the mark and posts the ECB, thus permitting the waiting program
to continue. In the two examples given,
all programs using a particular SRR must
use either the LIFO queuing scheme or
the FIFO scheme; the two cannot be
mixed. When more complex queuing is
required, it is suggested that the queue
for the SRR be locked using one of the
two methods shown.LOCK/UNLOCK with LIFO Queuing for Contentions The header consists of a word, that is, a four-byte field aligned on a word
boundary. The word can contain zero, a
positive value, or a negative value.
• A zero value indicates that the
serially reusable resource (SRR) is
free.
• A negative value indicates that the
SRR is in use but no additional
programs are waiting for the SRR.
• A positive value indicates that the
SRR is in use and that one or more
additional programs are waiting for
the SRR. Each waiting program is
identified by an element in a
chained list. The positive value
in the header is the address of the
element most recently added to the
list.
Each element consists of two words. The
first word is used as anECB; the second
word is used as a pointer to the next
element in the list. A negative value
in a pointer indicates that the element
is the last element in the list. The
element is required only if the program
findsthe SRR locked and desires to be
placed in the list.
The following chart describes the action
taken for LIFOLOCK and LIFO UNLOCK routines. The routines following the
chart allow enabled code to perform the
actions described in the chart.
Appendix A. Number Representation and Instruction-Use Examples A-43
manner. The lock/unlock functions can
then be used as the interlock mechanism
for updating an SRR of any complexity.
The lock/unlock functions are based on
the use of a
the SRR. The header is the common
starting point for determining the
states of the SRR, either free or in
use, and also is used for queuing
requests when contentions occur.
requires that the program that encount
ers a
the
to continue. In the two examples given,
all programs using a particular SRR must
use either the LIFO queuing scheme or
the FIFO scheme; the two cannot be
mixed. When more complex queuing is
required, it is suggested that the queue
for the SRR be locked using one of the
two methods shown.
boundary. The word can contain zero, a
positive value, or a negative value.
• A zero value indicates that the
serially reusable resource (SRR) is
free.
• A negative value indicates that the
SRR is in use but no additional
programs are waiting for the SRR.
• A positive value indicates that the
SRR is in use and that one or more
additional programs are waiting for
the SRR. Each waiting program is
identified by an element in a
chained list. The positive value
in the header is the address of the
element most recently added to the
list.
Each element consists of two words. The
first word is used as an
word is used as a pointer to the next
element in the list. A negative value
in a pointer indicates that the element
is the last element in the list. The
element is required only if the program
finds
placed in the list.
The following chart describes the action
taken for LIFO
chart allow enabled code to perform the
actions described in the chart.
Appendix A. Number Representation and Instruction-Use Examples A-43