US 7,500,242 B2
Low-contention lock
Sanjiv M. Shah, Champaign, Ill. (US); Paul M. Petersen, Champaign, Ill. (US); and Grant E. Haab, Mahomet, Ill. (US)
Assigned to Intel Corporation, Santa Clara, Calif. (US)
Filed on Sep. 08, 2003, as Appl. No. 10/658,626.
Prior Publication US 2005/0055593 A1, Mar. 10, 2005
Int. Cl. G06F 9/46 (2006.01); G06F 12/00 (2006.01); G06F 12/14 (2006.01); G06F 13/14 (2006.01); G06F 13/00 (2006.01); G06F 13/28 (2006.01)
U.S. Cl. 718—104  [710/200; 710/240; 711/150; 711/151] 44 Claims
OG exemplary drawing
 
1. A method of managing a lock utilized by a plurality of threads executing on a computing device to coordinate access to a shared resource, the method comprising:
selecting by one of the threads, an action to be performed by the thread upon the lock, wherein the action is selected from a group comprising:
acquiring the lock,
trying to acquire the lock, and
releasing the lock;
asynchronously querying and receiving a first state of the lock as a current state of the lock by the thread, the lock being considered to be in any one of at least four states in any point in time, the states defined by a state machine associated with the lock;
speculatively determining by the thread, a second state of the lock based at least in part on the first state and the selected action; and
attempting to perform by the thread, the selected action to transition the lock from the first state to the speculatively determined second state, the attempting including determining if the first state remains the current state of the lock, and, if the first state remains the current state, performing the selected action to transition the current state of the lock to the second state.