☜ | LOCK1977 Version of ANSI Standard | ☞ |
L[OCK] postcond | │ │ │ |
[ ] L lockargument |
│ │ │ |
lockargument | ::= | │ │ │ │ │ │ |
@ expratom V L lockargument |
│ │ │ │ │ │ |
nref | ::= | │ │ │ |
[ ^ ] name [ ( L expr ) ] @ expratom V nref |
│ │ │ |
See also the transition diagram for nref.
LOCK provides a generalized interlock facility available to concurrently executing MUMPS processes to be used as appropriate to the applications being programmed. Execution of LOCK is not affected by, nor does it directly affect, the state or value of any global or local variable, or the value of the naked indicator.
Each lockargument specifies a subspace of the total MUMPS name space for which the executing process seeks to make an exclusive claim; the details of this subspace specification are given below. Prior to evaluating and executing each lockargument, LOCK first unconditionally removes any prior claim on any portion of the name space made by the process as the result of a prior execution of LOCK. Then, if a lockargument is present, an attempt is made to claim the entire subspace defined by the lockargument. If this subspace does not intersect the union of all other subspaces claimed at this instant by all other processes defined by the implementor as sharing the interlock facility, the claim is successfully established and execution proceeds to the next lockargument or command. If the subspace defined by the lockargument intersects any other claimed subspace, execution of this process is suspended until all interfering claims are removed by one or more other processes, or, when a timeout is present, until the timeout expires, if that occurs first.
The subspace defined by one lockargument is claimed effectively all at once or not at all; thus, the observance of appropriate conventions on the use of the name space by all concurrently executing processes can eliminate the possibility of races and deadlocks.
If a timeout is present, the condition reported by ST upon resumption of execution is the successful establishment of the claim. If no timeout is present, execution of the lockargument does not change $T.
The subspace of the total name space defined by each lockargument is the union of the subspaces defined by each of the name references nref in the lockargument. Each nref specifies its subspace as follows.
See also the transition diagram for Lock.
Copyright © Standard Documents; 1977-2024 MUMPS Development Committee;
Copyright © Examples: 1995-2024 Ed de Moel;
Copyright © Annotations: 2003-2008 Jacquard Systems Research
Copyright © Annotations: 2008-2024 Ed de Moel.
This page most recently updated on 15-Nov-2023, 14:45:36.
For comments, contact Ed de Moel (demoel@jacquardsystems.com)