Browse Prior Art Database

Shared/exclusive fast synchronization method

IP.com Disclosure Number: IPCOM000019221D
Original Publication Date: 2003-Sep-05
Included in the Prior Art Database: 2003-Sep-05
Document File: 1 page(s) / 57K

Publishing Venue

IBM

Abstract

Fast exclusive/shared lock mechanism is a mechanism to obtain a share or exclusive lock with about the same amount of overhead as a primitive spin lock. It is recommended for short duration locks such as locks to synchronize data structures in memory.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 66% of the total text.

Page 1 of 1

Shared/exclusive fast synchronization method

Fast Shared/Exclusive Synchronization Primitives

This mechanism provides a shared/exclusive lock mechanism with roughly the same amount of processing as a primitive spin lock. It provides up to N share lockers, with N being setable to any number required. This mechanism as is best suited for short duration locks since it can spin if the lock is unavailable. If an exclusive lock is being obtained and there are active share lockers for a long period of time or if the maximum number of share lockers has been exceeded then it can cause a "yield". It is also not recommended that the program do a "yield" when this lock is obtained. This is optimized for a higher number of shared lockers than exclusive lockers. If the access is primarily exclusive than this algorithm won't result in a large performance gain.

To obtain a lock you must specify whether it is a shared or exclusive lock. This software first obtains a spin mutex to protect the data structures it is manipulating. An array of N entries is allocated where N is the maximum number of concurrent share lockers. In the case of an exclusive lock all N array entries are set to "E" when the exclusive lock is successfully

obtained.

In case of a shared lock, one entry of the array that was set to blank is set to "S". In the case of shared lockers the number of the array entry allocated to the share locker (that is, set to "S") is returned from the lock routine so the caller can...