MANAGING A LOCK TO A RESOURCE SHARED AMONG A PLURALITY OF PROCESSORS
First Claim
1. A computer program product for managing a lock for a shared resource accessed by a plurality of processors in communication with a memory, wherein the computer program product comprising a computer readable storage medium having computer readable program code embodied therein that executes to cause operations operations, the operations comprising:
- maintaining slots in the memory to implement the lock on the shared resource, wherein the slots correspond to counter values that are consecutively numbered and indicate one of busy and free;
fetching, by a requesting processor comprising one of the processors requesting the lock for the shared resource, a counter value comprising a fetched counter value;
determining whether the slot corresponding to the fetched counter value indicates free;
inserting a processor identifier of the requesting processor into the slot corresponding to the fetched counter value in response to determining that the slot corresponding to the fetched counter value indicates not free; and
accessing, by the requesting processor, the shared resource in response to determining that the slot corresponding to the fetched counter value indicates free.
1 Assignment
0 Petitions
Accused Products
Abstract
Provided are a computer program product, system, and method for managing a lock to a resource shared among a plurality of processors. Slots in a memory implement the lock on the shared resource. The slots correspond to counter values that are consecutively numbered and indicate one of busy and free. A requesting processor fetches a counter value comprising a fetched counter value. A determination is made as to whether the slot corresponding to the fetched counter value indicates free. A processor identifier of the requesting processor is inserted into the slot corresponding to the fetched counter value in response to determining that the slot corresponding to the fetched counter value indicates not free. The requesting processor accesses the shared resource in response to determining that the slot corresponding to the fetched counter value indicates free.
-
Citations
27 Claims
-
1. A computer program product for managing a lock for a shared resource accessed by a plurality of processors in communication with a memory, wherein the computer program product comprising a computer readable storage medium having computer readable program code embodied therein that executes to cause operations operations, the operations comprising:
-
maintaining slots in the memory to implement the lock on the shared resource, wherein the slots correspond to counter values that are consecutively numbered and indicate one of busy and free; fetching, by a requesting processor comprising one of the processors requesting the lock for the shared resource, a counter value comprising a fetched counter value; determining whether the slot corresponding to the fetched counter value indicates free; inserting a processor identifier of the requesting processor into the slot corresponding to the fetched counter value in response to determining that the slot corresponding to the fetched counter value indicates not free; and accessing, by the requesting processor, the shared resource in response to determining that the slot corresponding to the fetched counter value indicates free. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)
-
-
14. A system, comprising:
-
a plurality of processors; a memory accessed by the plurality of processors; and a computer readable storage medium having computer program code executed by at least one of the processors to perform operations, the operations comprising; maintaining slots in the memory to implement a lock on a shared resource, wherein the slots correspond to counter values that are consecutively numbered and indicate one of busy and free; fetching, by a requesting processor comprising one of the processors requesting the lock for the shared resource, a counter value comprising a fetched counter value; determining whether the slot corresponding to the fetched counter value indicates free; inserting a processor identifier of the requesting processor into the slot corresponding to the fetched counter value in response to determining that the slot corresponding to the fetched counter value indicates not free; and accessing, by the requesting processor, the shared resource in response to determining that the slot corresponding to the fetched counter value indicates free. - View Dependent Claims (15, 16, 17, 18, 19, 20)
-
-
21. A method for managing a lock for a shared resource accessed by a plurality of processors, comprising:
-
maintaining slots in the memory to implement the lock on the shared resource, wherein the slots correspond to counter values that are consecutively numbered and indicate one of busy and free; fetching, by a requesting processor comprising one of the processors requesting the lock for the shared resource, a counter value comprising a fetched counter value; determining whether the slot corresponding to the fetched counter value indicates free; inserting a processor identifier of the requesting processor into the slot corresponding to the fetched counter value in response to determining that the slot corresponding to the fetched counter value indicates not free; and accessing, by the requesting processor, the shared resource in response to determining that the slot corresponding to the fetched counter value indicates free. - View Dependent Claims (22, 23, 24, 25, 26, 27)
-
Specification