VMS Help
V73 Features, Programming Features, RMS Locking Enhancements

 *Conan The Librarian (sorry for the slow response - running on an old VAX)

    This section introduces the new Record Management Services (RMS)
    enhancements provided in this release.

  1 - RMS Locking Performance (Alpha)

    The following sections describe RMS locking performance
    enhancements that are in OpenVMS Alpha Version 7.2-1H1 and in
    OpenVMS Version 7.3.

 1.1 - RMS Global Buffer Read-Mode Locking

 In the RMS run-time processing environment, the use of global
 buffers can minimize I/O operations for shared files. This release
 introduces read-mode bucket locking that minimizes locking for
 shared access to global buffers. This new functionality:

    o  Allows concurrent read access to the global buffers. Accesses
       are no longer serialized, waiting to acquire an exclusive lock
       for a read access.

    o  Caches the read-mode lock as a system lock, which is retained
       over accesses and only lowered to null when the lock is
       blocking an exclusive write request. This functionality
       significantly reduces both local and remote lock request
       traffic (the number of $ENQ and $DEQ system service calls)
       as well as associated IPL-8 spinlock activity and System
       Communications Services (SCS) messages for a cluster.

    o  Does not increase lock resource names or the number of active
       system or process locks on the system.

    o  Is functionally compatible in mixed version clusters that
       include both Alpha and VAX computers.

    This new functionality applies to read operations (using the $GET
    and $FIND services) for all three file organizations: sequential,
    relative, and indexed. It also applies to a write operation
    (using the $PUT service) for the read accesses used for index
    buckets the first time through an index tree for the write.

    You do not need to make changes to existing applications to
    implement the read-only global bucket locks. However, global
    buffers must be set on a data file to take advantage of the
    enhancement. Use the following DCL command, where n is the number
    of buffers:

    $ SET FILE/GLOBAL_BUFFER=n <filename>

    For information about specifying the number of buffers, refer
    to the OpenVMS DCL Dictionary. For general information about
    using global buffers, refer to the section entitled Using
    Global Buffers for Shared Files in the Guide to OpenVMS File
    Applications.

    In a mixed cluster environment where there may be high contention
    for specific buckets, the Alpha nodes that are using read-mode
    global bucket locking may dominate accesses to write-shared
    files, thereby preventing timely access by other nodes.

    With the new /CONTENTION_POLICY=keyword qualifier to the SET RMS_
    DEFAULT command, you can specify the level of locking fairness at
    the process or system level for environments that experience high
    contention conditions.

    For more information about using the /CONTENTION_POLICY=keyword
    qualifier, refer to the SET RMS_DEFAULT section of the OpenVMS
    DCL Dictionary.

 1.2 - No Query Record Locking Option

    This release introduces new functionality that can minimize
    record locking for read accesses to shared files, thereby
    avoiding the processing associated with record locking calls
    to the Lock Manager.

    In previous releases, if a file is opened allowing write sharing,
    an exclusive record lock is taken out for all record operations
    (both read and write). Applications may obtain record locking
    modes other than the exclusive lock (default) by specifying
    certain options to the RAB$L_ROP field. However, all the options
    involve some level of record locking. That is, the options
    require $ENQ or $DEQ system service calls to the Lock Manager.

    The user record locking options include the RAB$V_NLK (no lock)
    query locking option, which requests that RMS take out a lock
    to probe for status and not hold the lock for synchronization.
    If the lock is not granted (exclusive lock held) and the read-
    regardless (RAB$V_RRL) option is not set, the record access fails
    with an RMS$_RLK status. Otherwise, the record is returned with
    one of the following statuses:

    o  RMS$_SUC - No other writers

    o  RMS$_OK_RLK - Record can be read but not written

    o  RMS$_OK_RRL - Exclusive lock is held (lock request denied) but
       the read-regardless (RAB$V_RRL) option is set

    When only the RAB$V_NLK option is specified, record access can
    be denied. When both the RAB$V_NLK and RAB$V_RRL options are
    specified, an application can guarantee the return of any record
    with a success or alternate success status.

    This release introduces the no query record locking option,
    which allows applications to read records (using $GET or $FIND
    services) without any consideration of record locking. This
    option:

    o  Does not make a call to the Lock Manager

    o  Is equivalent to both RAB$V_NLK and RAB$V_RRL being set
       except that the RMS$_OK_RLK or RMS$_OK_RRL status will not
       be returned

    This functionality is independent of bucket locks. It applies to
    both local and global buffers and to all three file organizations
    (sequential, relative, and indexed).

    Three alternate methods for specifying the no query record
    locking option are outlined in Methods Available for Specifying
    No Query Record Locking.

    Note the following:

    o  The first method allows the option to be enabled externally,
       potentially without any application change.

    o  You should use any of the methods only as appropriate for
       the application. In particular, you should check for any
       dependency in an existing application on the alternate success
       status RMS$_OK_RLK or RMS$_OK_RRL.

    Table 5-2 Methods Available for Specifying No Query Record
              Locking

    To...                  Use This Method...

    Disable query record   Enter the following DCL command to request
    locking at the         that RMS use no query record locking for
    process or system      any read operation with both RAB$V_NLK
    level.                 and RAB$V_RRL options set in the RAB$L_ROP
                           field:

                           $ SET RMS_DEFAULT/QUERY_LOCK=
                                             DISABLE[/SYSTEM]

                           Keys on RAB$V_NLK and RAB$V_RRL options in
                           existing applications.
    Enable no query        Set the RAB$V_NQL option in the RAB$W_ROP_
    record locking on      2 field.
    a per-record read
    operation.             The RAB$V_NQL option takes precedence
                           over all other record locking options. Use
                           only if the current read ($GET or $FIND)
                           operation is not followed by an $UPDATE or
                           $DELETE call.
    Enable no query        Set the FAB$V_NQL option in the FAB$B_SHR
    record locking at      field to request that RMS use no query
    the file level.        locking for the entire period the file is
                           open for any read record operation with
                           both RAB$V_NLK and RAB$V_RRL options set
                           in the RAB$L_ROP field.

                           This option can be used with any
                           combination of the other available FAB$B_
                           SHR sharing options. Keys on RAB$V_NLK and
                           RAB$V_RRL options in applications.

    RMS precedence for the no query record locking option is as
    follows:

    o  The RAB$V_NQL option set in the RAB$W_ROP_2 field

    o  At file open (and applied, if RAB$V_NLK and RAB$V_RRL are set
       for the read operation):

       -  The FAB$V_NQL option set in the FAB$B_SHR field

       -  The SET RMS_DEFAULT/QUERY_LOCK=DISABLE setting at the
          process level

       -  The SET RMS_DEFAULT/QUERY_LOCK=DISABLE setting at the
          system level. If the process /QUERY_LOCK setting equals
          SYSTEM_DEFAULT (the default when the process is created),
          RMS uses the system specified value.

    For more information, see OpenVMS Record Management Services
    Reference Manual.

  2 - Record Locking Options

    RMS uses the distributed Lock Manager ($ENQ system service) for
    record locking.

    To help prevent false deadlocks, the distributed Lock Manager
    uses the following flags for lock requests:

    Flag           Purpose

    LCK$M_         When set, the lock management services do not
    NODLCKWT       consider this lock when trying to detect deadlock
                   conditions.
    LCK$M_         When set, the lock management services do not
    NODLCKBLK      consider this lock as blocking other locks when
                   trying to detect deadlock conditions.

    In previous releases, RMS did not set these flags in its record
    lock requests.

    With this release, you can optionally request that RMS set
    these flags in record lock requests by setting the corresponding
    options RAB$V_NODLCKWT and RAB$V_NODLCKBLK in the new RAB$W_ROP_2
    field. For more information about using these options, refer to
    the flag information in the $ENQ section of the OpenVMS System
    Services Reference Manual: A-GETUAI.
  Close     HLB-list     TLB-list     Help  

[legal] [privacy] [GNU] [policy] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.