Browse Prior Art Database

Weak Locks With Two-Level Locking Multi-Computer System Protocol to Reduce Lock-Holding Time

IP.com Disclosure Number: IPCOM000101677D
Original Publication Date: 1990-Aug-01
Included in the Prior Art Database: 2005-Mar-16
Document File: 3 page(s) / 146K

Publishing Venue

IBM

Related People

Dias, DM: AUTHOR [+3]

Abstract

A technique is described whereby multi-computer systems using a two-level locking protocol use weak locks at the first level to reduce lock-holding time, thereby reducing system contention.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 42% of the total text.

Weak Locks With Two-Level Locking Multi-Computer System Protocol to Reduce Lock-Holding Time

       A technique is described whereby multi-computer systems
using a two-level locking protocol use weak locks at the first level
to reduce lock-holding time, thereby reducing system contention.

      Multi-system data sharing typically requires global concurrency
control.  However, transactions that contend for a lock must wait for
the completion of another transaction holding the lock.  Waiting on
locks increases the probability of lock contention.  Therefore, the
longer the lock-holding time, the longer the wait time, and the
larger the lock contention.  The probability of lock contention is
typically proportional to the response time, including waits while
holding locks.

      Reducing lock hold time is critical in high-contention
environments.  Since a large part of the lock-holding time is due to
input/ output (I/O) device contention, transactions are often run
twice; first, to read information from a disk, without requesting
locks, and a second time to do the real computation with concurrency
control.  This approach can easily double the processing time.  The
concept described herein utilizes a two-level protocol with weak
locks at the first level to reduce lock-holding time.  A weak lock is
a lock that can be unlocked by a request for a strong lock on the
entity.

      Utilizing the two-level protocol, where level 1 performs
contention detection and level 2 performs compatibility checking and
queueing, transactions are run in two phases.  A second phase is run
only if contention is detected at level 1 during first phase.  In the
first phase, weak locks at level 1 are obtained on entities, and the
transaction is run normally.  At the end of the first phase, level 1
is used to detect if all weak locks were obtained and that no other
transactions in the interim converted to strong locks.  This would
indicate absence of contention with a transaction in phase two.  If
so, the transaction commits, writes out updates and does not run any
phase two. If a contention occurred, the transaction restarts and
acquires strong locks at level 1 and level 2.

      It should be noted that transactions do not hold strong locks
in phase one and, therefore, do not block other transactions and do
the necessary disk read.  The data is retained in local system
buffers, so that in the second phase, transactions use strong locks,
but have the read data in local buffers.  This provides a small
lock-holding time.

      The changes required to level 1 are as follows:  Level 1
handles a new weak lock mode, known as the k-mode.  A request for a
k-mode lock is granted with a positive acknowledgement (ACK) only if
the entity is free at level 1; otherwise, a negative acknowledgement
(NAK) is returned.  Level 1 retains lock ownership on a transaction
basis.  This can be a concatenation of the system name and
transaction identif...