ALMOST FAIR BUSY LOCK
First Claim
1. A method for managing exclusive control of a shareable resource, the method comprising:
- publishing a claim non atomically to a lock by a thread that is next to own the lock in an ordered set of threads that have requested to own the lock, the claim comprising a structure capable of being read and written only in a single memory access;
determining whether the next owning thread has been pre-empted;
responsive to the determination, the next owning thread of the lock acquiring the lock if the next owning thread has not been pre-empted and retrying acquisition of the lock if the next owning thread has been pre-empted; and
responsive to the next owning thread being pre-empted, a subsequent owning thread acquiring the lock unfairly and atomically, consistently modifying the lock such that a next lock owner can determine that the next lock owner has been preempted.
1 Assignment
0 Petitions
Accused Products
Abstract
Managing exclusive control of a shareable resource includes publishing a claim non atomically to a lock by a thread that is next to own the lock in an ordered set of threads that have requested to own the lock. The claim includes a structure capable of being read and written only in a single memory access. A determination is made of whether the next owning thread has been pre-empted. Responsive to the determination, the next owning thread of the lock acquires the lock if the next owning thread has not been pre-empted and retries acquisition of the lock if the next owning thread has been pre-empted. Responsive to the next owning thread being pre-empted, a subsequent owning thread acquires the lock unfairly and atomically, consistently modifies the lock such that a next lock owner can determine that the next lock owner has been preempted.
22 Citations
15 Claims
-
1. A method for managing exclusive control of a shareable resource, the method comprising:
-
publishing a claim non atomically to a lock by a thread that is next to own the lock in an ordered set of threads that have requested to own the lock, the claim comprising a structure capable of being read and written only in a single memory access; determining whether the next owning thread has been pre-empted; responsive to the determination, the next owning thread of the lock acquiring the lock if the next owning thread has not been pre-empted and retrying acquisition of the lock if the next owning thread has been pre-empted; and responsive to the next owning thread being pre-empted, a subsequent owning thread acquiring the lock unfairly and atomically, consistently modifying the lock such that a next lock owner can determine that the next lock owner has been preempted. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A system for managing exclusive control of a shareable resource between a plurality of concurrently executing threads, comprising:
-
a lock for controlling access to the shareable resource, the lock maintaining an ordered set of threads requesting ownership of the lock; a claim structure, capable of being read and written only in a single memory access, non-atomically published by a next owning thread, in the ordered set of threads, making a claim to the lock; and one or more processors, one or more computer-readable memories, one or more computer-readable tangible storage devices, and program instructions stored on at least one of the one or more storage devices for execution by at least one of the one or more processors via at least one of the one or more memories, wherein the system is capable of performing a method comprising; the next owning thread of the lock, after publishing the claim, determining whether the next owning thread has been pre-empted; responsive to determining whether the next owning thread has been pre-empted, the next owning thread of the lock acquiring the lock if the next owning thread has not been pre-empted and retrying acquisition of the lock if the next owning thread has been pre-empted; and responsive to the next owning thread being pre-empted, a subsequent owning thread acquiring the lock unfairly and atomically, consistently modifying the lock such that a next lock owner can determine that the next lock owner has been preempted. - View Dependent Claims (7, 8, 9, 10)
-
-
11. The computer program product for managing exclusive control of a shareable resource, the computer program product comprising:
-
one or more computer-readable storage devices and program instructions stored on at least one of the one or more tangible storage devices, the program instructions executable by a processor, the program instructions comprising; program instructions to publish a claim non atomically to a lock by a thread that is next to own the lock in an ordered set of threads that have requested to own the lock, the claim comprising a structure capable of being read and written only in a single memory access; program instructions to determine whether the next owning thread has been pre-empted; responsive to the determination, program instructions to the next owning thread of the lock to acquire the lock if the next owning thread has not been pre-empted and to retry acquisition of the lock if the next owning thread has been pre-empted; and responsive to the next owning thread being pre-empted, program instructions to a subsequent owning thread to acquire the lock unfairly and atomically, consistently modifying the lock such that a next lock owner can determine that the next lock owner has been preempted. - View Dependent Claims (12, 13, 14, 15)
-
Specification