LOCK Macro
label LOCK Use the LOCK macro to obtain or release a lock. The format of the LOCK macro
is: {OBTAIN SYS [, SPIN= '{ P [, SAVE]
RELEASE VMBLOK [,OPTion=NOUPDT] FREE
RL
TR DS 10 RM
PRIVATE
where:
label
is any desired label
OBTAIN
RELEASE
is a required positional operand indicating whether the lock is to be
obtained or released. TYPE= is a required positional operand. The possible parameters are:
SYS for the global system lock
VMBLOK for the VMBLOK
FREE for the free storage lock
RL for the runlist lock
TR for the timer request queue lock
DS for the dispatch lock 10 for the 110 lock
RM for the real storage management lock PRIVATE for a private user-defined lock If you have user-defined areas
that are used by more than one virtual machine, you will need to
define your own locking conventions. You can use the LOCK
macro to obtain and release a private lock.
The system programmer must specify the address of the
lockword in register 1 and the lockword must be a full word
aligned on a fullword boundary. Spin time for private locks is
kept in the DMKLOKSI timer value for all non-DMKLOK
locks.
CP in Attached Processor and Multiprocessor Modes 217
I Affinity I How to Set Afrmity
SPIN = {YES I NO} SAVE
specifies whether control is to be returned without the lock being held. The
default is SPIN = YES.
is an optional keyword that indicates register 0, 1, 14, and 15 are to be
saved before the rest of the macro expansion. These registers are saved in
the PSA of the processor that is executing this macro. The registers are
restored before exit from the macro expansion. OPTION =NOUPDT indicates that the VMBLOK should be locked without checking for shared
segments.
Condition Codes
The condition code (cc) is set as a result of the invocation of the LOCK macro.
Condition
Code cc=O cc=l
Parameter OBTAIN RELEASE OB'rAIN, SPIN=NO Meaning
lock obtained
lock released
lock owned by another
processor
For various abend codes related to lock usage, see VM/SP System Messages and
Codes.
When you specify the affinity option for a virtual machine, the program of that vir­
tual machine is executed only on the specified processor. You might want to speci­
fy affinity in the following cases:
If one processor has a special hardware feature or a special RPQ that is
required for a particular program, set affinity to this processor. If a virtual machine has a high I/O-to-compute ratio, you might want to set
affinity to the I/O processor. On the other hand, if a virtual machine has a
high compute-to-I/O ratio, you could set affinity to the attached processor.
You request affinity either in the directory or with a SET AFFINITY command.
See the VM / SP CP Command Reference for General Users for details on the class
G SET AFFINITY command. See the VM / SP Operator's Guide for other privilege
classes of the SET AFFINITY command. Shared Segments in an AP / MP Environment
When two processors are executing simultaneously, it is necessary to know when a
user changes a shared page. In attached processor or multiprocessor mode, there
are two sets of page tables and swap tables maintained for each shared segment
unless a user is running unprotected. If a user is running unprotected shared seg­
ments, there is only one copy.
218 VM/SP System Programmer's Guide
Previous Page Next Page