Operating System - OpenVMS

Locking Mechanism in VMS

 
Jon Pinkley
Honored Contributor

Re: Locking Mechanism in VMS

Attached is a log of three processes using resource XYZ, and the effects of the EXPEDITE and QUECVT flags. This was done using Ken Coar's LOCK utility.

Forcing all waiting to occur in the conversion queue by converting NL locks to more restrictive modes, and using the QUEQVT flag to force FIFO processing of the locks being converted achieves the behavior that ajaydec specified that he wants.

Hoff, I am interested in your comment that a $DEQ may not always be synchronous. Can you be more specific about the cause, and what conditions must be present for this to occur?

I have never heard of this problem before.

I can understand that it may be "cleaner" to always convert to NL before the $DEQ, but I am trying to figure out how the $ENQ CVT to NL before the $DEQ avoids the "nasty race condition".
it depends
Hoff
Honored Contributor

Re: Locking Mechanism in VMS

>>> Hoff, I am interested in your comment that a $DEQ may not always be synchronous. Can you be more specific about the cause, and what conditions must be present for this to occur?<<<

$deq is effectively asynchronous due to how the underlying locking protocol is implemented. The $deq kicks off the processing, but there's no acknowledgment sequence for the completion of the $deq. If a $deq operation in a cluster is started and is followed by an $enq for the same resource, there might well be a collision with the $deq.

$enq down to NL is synch; there's an ack. Then the $deq doesn't matter, beyond releasing the resource if and as required.

I've posted an intro and some related details (including this wrinkle) at the web site:

http://64.223.189.234/node/492

Not applicable

Re: Locking Mechanism in VMS

regards,
ajaydec