Tiered locking of resources
First Claim
1. A method comprising:
- receiving, from a first thread, a lock command that specifies a resource;
if tier status in a nodal lock indicates the nodal lock is currently owned on global data, adding an identifier of the first thread to a nodal waiters list in the nodal lock, and if a lock wait indicator in the first thread indicates that the first thread owns the nodal lock on the global data, waiting until a next tier wait indicator in the nodal lock indicates that any thread owns a global lock on the resource and then returning a successful completion status for the lock command to the first thread;
if the tier status indicates no thread holds the nodal lock on the global data, changing the tier status to indicate the nodal lock is owned, and if a global waiters and holder list in the global data is empty, adding an identifier of a first node at which the first thread executes to the global waiters and holder list, and returning the successful completion status for the lock command to the first thread;
if the tier status indicates no thread holds the nodal lock on the global data, changing the tier status to indicate the nodal lock is owned, and if the identifier of the first node at which the first thread executes is in the global waiters and holder list, adding the identifier of the first node at which the first thread executes to a global pending waiters list in the global data, and returning the successful completion status for the lock command to the first thread; and
if the tier status indicates no thread holds the nodal lock on the global data, changing the tier status to indicate the nodal lock is owned, and if the identifier of the first node at which the first thread executes is not in the global waiters and holder list, adding the identifier of the first node at which the first thread executes to the global waiters and holder list, and returning the successful completion status for the lock command to the first thread.
1 Assignment
0 Petitions
Accused Products
Abstract
In an embodiment, a lock command is received from a thread that specifies a resource. If tier status in a nodal lock indicates the nodal lock is currently owned, an identifier of the thread is added to a nodal waiters list, and if the thread'"'"'s lock wait indicator indicates that the thread owns the nodal lock, then a successful completion status is returned for the lock command to the thread after waiting until a next tier wait indicator in the nodal lock indicates that any thread owns a global lock on the resource. If the tier status indicates no thread holds the nodal lock, the tier status is changed to indicate the nodal lock is owned, and if a global waiters and holder list is empty, an identifier of a node at which the thread executes is added to the global waiters and holder list.
-
Citations
20 Claims
-
1. A method comprising:
-
receiving, from a first thread, a lock command that specifies a resource; if tier status in a nodal lock indicates the nodal lock is currently owned on global data, adding an identifier of the first thread to a nodal waiters list in the nodal lock, and if a lock wait indicator in the first thread indicates that the first thread owns the nodal lock on the global data, waiting until a next tier wait indicator in the nodal lock indicates that any thread owns a global lock on the resource and then returning a successful completion status for the lock command to the first thread; if the tier status indicates no thread holds the nodal lock on the global data, changing the tier status to indicate the nodal lock is owned, and if a global waiters and holder list in the global data is empty, adding an identifier of a first node at which the first thread executes to the global waiters and holder list, and returning the successful completion status for the lock command to the first thread; if the tier status indicates no thread holds the nodal lock on the global data, changing the tier status to indicate the nodal lock is owned, and if the identifier of the first node at which the first thread executes is in the global waiters and holder list, adding the identifier of the first node at which the first thread executes to a global pending waiters list in the global data, and returning the successful completion status for the lock command to the first thread; and if the tier status indicates no thread holds the nodal lock on the global data, changing the tier status to indicate the nodal lock is owned, and if the identifier of the first node at which the first thread executes is not in the global waiters and holder list, adding the identifier of the first node at which the first thread executes to the global waiters and holder list, and returning the successful completion status for the lock command to the first thread. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A non-transitory computer-readable storage medium encoded with instructions, wherein the instructions when executed by a computer comprise:
-
receiving, from a first thread, a lock command that specifies a resource; if tier status in a nodal lock indicates the nodal lock is currently owned on global data, adding an identifier of the first thread to a nodal waiters list in the nodal lock, and if a lock wait indicator in the first thread indicates that the first thread owns the nodal lock on the global data, waiting until a next tier wait indicator in the nodal lock indicates that any thread owns a global lock on the resource and then returning a successful completion status for the lock command to the first thread; if the tier status indicates no thread holds the nodal lock on the global data, changing the tier status to indicate the nodal lock is owned, and if a global waiters and holder list in the global data is empty, adding an identifier of a first node at which the first thread executes to the global waiters and holder list, and returning the successful completion status for the lock command to the first thread; if the tier status indicates no thread holds the nodal lock on the global data, changing the tier status to indicate the nodal lock is owned, and if the identifier of the first node at which the first thread executes is in the global waiters and holder list, adding the identifier of the first node at which the first thread executes to a global pending waiters list in the global data, and returning the successful completion status for the lock command to the first thread; and if the tier status indicates no thread holds the nodal lock on the global data, changing the tier status to indicate the nodal lock is owned, and if the identifier of the first node at which the first thread executes is not in the global waiters and holder list, adding the identifier of the first node at which the first thread executes to the global waiters and holder list, and returning the successful completion status for the lock command to the first thread. - View Dependent Claims (9, 10, 11, 12, 13, 14)
-
-
15. A computer comprising:
-
a processor; and memory communicatively coupled to the processor, wherein the memory is encoded with instructions, wherein the instructions when executed by the processor comprise receiving, from a first thread, a lock command that specifies a resource, if tier status in a nodal lock indicates the nodal lock is currently owned on global data, adding an identifier of the first thread to a nodal waiters list in the nodal lock, and if a lock wait indicator in the first thread indicates that the first thread owns the nodal lock on the global data, waiting until a next tier wait indicator in the nodal lock indicates that any thread owns a global lock on the resource and then returning a successful completion status for the lock command to the first thread, if the tier status indicates no thread holds the nodal lock on the global data, changing the tier status to indicate the nodal lock is owned, and if a global waiters and holder list in the global data is empty, adding an identifier of a first node at which the first thread executes to the global waiters and holder list, and returning the successful completion status for the lock command to the first thread, if the tier status indicates no thread holds the nodal lock on the global data, changing the tier status to indicate the nodal lock is owned, and if the identifier of the first node at which the first thread executes is in the global waiters and holder list, adding the identifier of the first node at which the first thread executes to a global pending waiters list in the global data, and returning the successful completion status for the lock command to the first thread, if the tier status indicates no thread holds the nodal lock on the global data, changing the tier status to indicate the nodal lock is owned, and if the identifier of the first node at which the first thread executes is not in the global waiters and holder list, adding the identifier of the first node at which the first thread executes to the global waiters and holder list, and returning the successful completion status for the lock command to the first thread, and if the tier status indicates that no thread owns the nodal lock on the global data, changing the tier status to indicate the nodal lock is owned, and if the global waiters and holder list is not empty and the lock command is a try lock attempt command and the nodal waiters list is empty, changing the tier status in the nodal lock to indicate that no thread owns the nodal lock and returning a failure completion status for the lock command to the first thread. - View Dependent Claims (16, 17, 18, 19, 20)
-
Specification