Browse Prior Art Database

Fast Lock Acquisition through In-Line Generation and Interference Retry

IP.com Disclosure Number: IPCOM000113849D
Original Publication Date: 1994-Oct-01
Included in the Prior Art Database: 2005-Mar-27
Document File: 2 page(s) / 30K

Publishing Venue

IBM

Related People

Howard, JS: AUTHOR

Abstract

This method reduces the required path length for acquiring a semaphore lock via 390 architected compare and swap logic. The technique involves executing lock fast-path code in-line, then calling the pre-existing lock acquisition routine on failure and again attempting the fast-path logic before finally resorting to the long-path to queue up to get a lock.

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

Fast Lock Acquisition through In-Line Generation and Interference
Retry

      This method reduces the required path length for acquiring a
semaphore lock via 390 architected compare and swap logic.  The
technique involves executing lock fast-path code in-line, then
calling the pre-existing lock acquisition routine on failure and
again attempting the fast-path logic before finally resorting to the
long-path to queue up to get a lock.

      The solution is two-fold.  First, the compare and swap logic is
pulled in-line in performance sensitive paths via a macro that has
been updated to provide this function.  While this does not save a
great deal of pathlength per execution, it does save a large
composite number of instruction executions during normal system
operation due to the high rate of execution of the chosen code paths.

      Finally, when the compare and swap fails because of a non-zero
return code the pre-existing lock routine is called to again attempt
to acquire the lock.  As part of this, the so-called fast path logic
that was already executed in-line is re-executed in the lock routine
so that, if the lock has become available in the interim, it may
still be acquired in the fast path.  This avoids the "long path" to
acquire the lock in most cases.