Busy lock and a passive lock for embedded load management
First Claim
1. A method for managing exclusive control of a shareable resource between a plurality of concurrently executing threads, the method comprising:
- determining at intervals a number of concurrently executing threads waiting for exclusive control of the shareable resource;
comparing the number of concurrently executing threads waiting for exclusive control of the sharable resource to a pre-determined value;
responsive to the number of concurrently executing threads waiting for exclusive control of the shareable resource exceeding the pre-determined value and upon a determination that it is fair for one or more of said concurrently executing threads to terminate its wait, one or more of said concurrently executing threads terminating its wait for exclusive control of the shareable resource, the terminating including dropping a current ticket for the sharable resource and returning resources associated with the shareable resource for use by others of the concurrently executing threads; and
responsive to the number of concurrently executing threads waiting for exclusive control of the shareable resource not exceeding the pre-determined value, one or more of said one or more concurrently executing threads which terminated its wait for exclusive control of the shareable resource, restarting a wait for exclusive control of the shareable resource, the restarting including acquiring a new ticket for the sharable resource,wherein when it is determined that a concurrently executing thread has previously terminated and restarted a wait for exclusive control of the shareable resource, it does not terminate its wait for exclusive control of the shareable resource, and wherein when an exclusive control of the shareable resource is granted in an ordered manner, concurrently executing threads do not terminate their wait for exclusive control of the shareable resource when a preceding thread has terminated its wait for exclusive control of the shareable resource.
1 Assignment
0 Petitions
Accused Products
Abstract
Embodiments relate to managing exclusive control of a shareable resource between a plurality of concurrently executing threads. An aspect includes determining the number of concurrently executing threads waiting for exclusive control of the shareable resource. Another aspect includes, responsive to a determination that the number of concurrently executing threads waiting for exclusive control of the shareable resource exceeds a pre-determined value, one or more of said concurrently executing threads terminating its wait for exclusive control of the shareable resource. Another aspect includes, responsive to a determination that the number of concurrently executing threads waiting for exclusive control of the shareable resource is less than a pre-determined value, one or more of said one or more concurrently executing threads which terminated its wait for exclusive control of the shareable resource, restarting a wait for exclusive control of the shareable resource.
-
Citations
11 Claims
-
1. A method for managing exclusive control of a shareable resource between a plurality of concurrently executing threads, the method comprising:
-
determining at intervals a number of concurrently executing threads waiting for exclusive control of the shareable resource; comparing the number of concurrently executing threads waiting for exclusive control of the sharable resource to a pre-determined value; responsive to the number of concurrently executing threads waiting for exclusive control of the shareable resource exceeding the pre-determined value and upon a determination that it is fair for one or more of said concurrently executing threads to terminate its wait, one or more of said concurrently executing threads terminating its wait for exclusive control of the shareable resource, the terminating including dropping a current ticket for the sharable resource and returning resources associated with the shareable resource for use by others of the concurrently executing threads; and responsive to the number of concurrently executing threads waiting for exclusive control of the shareable resource not exceeding the pre-determined value, one or more of said one or more concurrently executing threads which terminated its wait for exclusive control of the shareable resource, restarting a wait for exclusive control of the shareable resource, the restarting including acquiring a new ticket for the sharable resource, wherein when it is determined that a concurrently executing thread has previously terminated and restarted a wait for exclusive control of the shareable resource, it does not terminate its wait for exclusive control of the shareable resource, and wherein when an exclusive control of the shareable resource is granted in an ordered manner, concurrently executing threads do not terminate their wait for exclusive control of the shareable resource when a preceding thread has terminated its wait for exclusive control of the shareable resource. - View Dependent Claims (2, 3, 4)
-
-
5. A system for managing exclusive control of a shareable resource between a plurality of concurrently executing threads, the system comprising:
-
a memory having computer readable computer instructions; and a processor for executing the computer readable computer instructions, the computer readable computer instructions comprising; determining at intervals a number of concurrently executing threads waiting for exclusive control of the shareable resource; comparing, by the processor, the number of concurrently executing threads waiting for exclusive control of the sharable resource to a pre-determined value; responsive to the number of concurrently executing threads waiting for exclusive control of the shareable resource exceeding the pre-determined value and upon a determination that it is fair for one or more of said concurrently executing threads to terminate its wait, one or more of said concurrently executing threads terminating its wait for exclusive control of the shareable resource, the terminating including dropping a current ticket for the sharable resource and returning resources associated with the shareable resource for use by others of the concurrently executing threads; and responsive to the number of concurrently executing threads waiting for exclusive control of the shareable resource not exceeding the pre-determined value, for one or more of said one or more concurrently executing threads which terminated its wait for exclusive control of the shareable resource, restarting a wait for exclusive control of the shareable resource, the restarting including acquiring a new ticket for the sharable resource, wherein when it is determined that a concurrently executing thread has previously terminated and restarted a wait for exclusive control of the shareable resource, it does not terminate its wait for exclusive control of the shareable resource, and wherein when an exclusive control of the shareable resource is granted in an ordered manner, concurrently executing threads do not terminate their wait for exclusive control of the shareable resource when a preceding thread has terminated its wait for exclusive control of the shareable resource. - View Dependent Claims (6, 7, 8)
-
-
9. A computer program product for managing exclusive control of a shareable resource between a plurality of concurrently executing threads, the computer program product comprising:
-
a computer readable storage medium having computer readable program code embodied therewith, the computer readable program code adapted to perform the following method when said program is run on a computer; determining at intervals a number of concurrently executing threads waiting for exclusive control of the shareable resource; comparing, by the processor, the number of concurrently executing threads waiting for exclusive control of the sharable resource to a pre-determined value; responsive to the number of concurrently executing threads waiting for exclusive control of the shareable resource exceeding the pre-determined value and upon a determination that it is fair for one or more of said concurrently executing threads to terminate its wait, one or more of said concurrently executing threads terminating its wait for exclusive control of the shareable resource, the terminating including dropping a current ticket for the sharable resource and returning resources associated with the sharable resource for use by others of the concurrently executing threads; and responsive to the number of concurrently executing threads waiting for exclusive control of the shareable resource not exceeding the pre-determined value, one or more of said one or more concurrently executing threads which terminated its wait for exclusive control of the shareable resource, restarting a wait for exclusive control of the shareable resource, the restarting including acquiring a new ticket for the sharable resource, wherein when it is determined that a concurrently executing thread has previously terminated and restarted a wait for exclusive control of the shareable resource, it does not terminate its wait for exclusive control of the shareable resource, and wherein when an exclusive control of the shareable resource is granted in an ordered manner, concurrently executing threads do not terminate their wait for exclusive control of the shareable resource when a preceding thread has terminated its wait for exclusive control of the shareable resource. - View Dependent Claims (10, 11)
-
Specification