[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference vaxaxp::vmsnotes

Title:VAX and Alpha VMS
Notice:This is a new VMSnotes, please read note 2.1
Moderator:VAXAXP::BERNARDO
Created:Wed Jan 22 1997
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:703
Total number of notes:3722

58.0. "Process Permanent Lock" by CHITS::WILSONP () Thu Jan 16 1997 12:29

T.RTitleUserPersonal
Name
DateLines
58.1What Is The Application?XDELTA::HOFFMANSteve, OpenVMS EngineeringThu Jan 16 1997 13:0630
58.2EVMS::MORONEYSYS$BOOM_BAHThu Jan 16 1997 14:185
58.3Crude, ugly and inefficient mechanism, but it might workGIDDAY::GILLINGSa crucible of informative mistakesThu Jan 16 1997 20:387
58.4KERNEL::WILSONPThu Jan 30 1997 08:3022
    Sorry for the delay in replying, I have been on a training
    course.
    >Rather than discussing specifics of the lock manager implementation,
    >please provide us with some specifics of the problem the customer is
    >trying to solve here.
    
    The requirement is to provide a cluster wide synchroning mechanism which 
    is available from DCL.
    
    Of course if we had CWLNMs they could be used ;-}...
    1/ To preventresource contention during startup the customer wants to
       implement a lock facility to DCL. i.e
    
    $ SYSLOCK LOCK FOO
    $ dcl commands...
    $ SYSLOCK UNLOCK FOO
    2/ For cluster wide login synchronisation and validation
    
    I don't think he would like anything that came from UNIX as he is a VMS 
    bigot:-(
    
    Seriously, the problems with file locks is the cleanup and I/O overhead.
58.5do it in DCLEVMS::KUEHNELAndy K�hnelThu Jan 30 1997 09:0919
    I'd still suggest a file-based solution.  There is hardly any I/O
    overhead and you get automatic cleanup if the process dies, and it can
    all be done very easily in DCL.
    
    All you need is a file that's created just once on a cluster-wide
    accessible volume.  Then you can:
    
    $lock_loop:
    $ open/read/write/error=lock_wait lock disk$mumble:[000000]lock_file.dat 
    $ !
    $ ! your protected DCL commands come here
    $ !
    $ close lock
    
    
    
    $lock_wait:
    $ wait 0:0:5
    $ goto lock_loop
58.6Is .2 wrongRTOAL2::MAHERTIER3 simply a better RPC!Thu Jan 30 1997 09:206
    Hi,
    
    Is Mike in .2 wrong? It sounds good to me and if the process dies
    before releasing the lock it will get blown away.
    
    Regards Richard Maher.
58.7EVMS::KUEHNELAndy K�hnelThu Jan 30 1997 14:318
    re .6
    
    I'm not a locking specialist, but it strikes me that anything involving
    an image activation can hardly involve less overhead than something
    done just within DCL.  .5 appears to solve the customer's problem and I
    just don't believe in unnecessary kernel mode hacks.
    
    -andy
58.8EVMS::MORONEYUHF ComputersThu Jan 30 1997 15:197
re .6:

I just verified that locks granted in exec or super mode do stick around
until process termination as expected.  Regardless, I agree with .7, .5
is at least a supported solution, and allows a multiple-reader mode
($ OPEN/READ) and an exclusive mode ($ OPEN/READ/WRITE).
It also doesn't require privileges.
58.9You need to use the lock mgr if you really want synchronization.WAYLAY::GORDONResident Lightning DesignerThu Jan 30 1997 18:035
	Cluster-wide logical names would not provide appropriate
synchronization. This has been the subject of some discussion here in
engineering.

					--Doug