Latch mechanism for concurrent computing environments
First Claim
1. A method for providing access to a resource in a programming environment supporting concurrent tasks, comprising the steps of:
- (a) providing a latch to a first task, wherein the first task requests the latch to obtain access to the resource;
(b) releasing the latch after the first task has accessed the resource, while still holding the latch;
(c) marking the latch stealable, while still holding the latch; and
(d) marking the latch unstealable if the latch is not marked stolen by a second task seeking access to the resource.
1 Assignment
0 Petitions
Accused Products
Abstract
A system, method and computer readable medium containing programming structions for an improved latch mechanism for use in a programming environment running concurrent tasks is disclosed. According to one aspect of the present invention, a latch is provided to a first task which is requesting access to a resource. After such access, the first task holds the latch, which is also released from the first task. The first task holding the latch marks the latch stealable, and if the latch is not marked stolen by another task, the first task can mark the latch unstealable. In another embodiment of the present invention, if the first task is provided a latch marked stealable, the resource associated with the stealable latch will be placed in a consistent state before the first task accesses the resource.
-
Citations
15 Claims
-
1. A method for providing access to a resource in a programming environment supporting concurrent tasks, comprising the steps of:
-
(a) providing a latch to a first task, wherein the first task requests the latch to obtain access to the resource;
(b) releasing the latch after the first task has accessed the resource, while still holding the latch;
(c) marking the latch stealable, while still holding the latch; and
(d) marking the latch unstealable if the latch is not marked stolen by a second task seeking access to the resource. - View Dependent Claims (2, 3, 4)
-
-
5. A computer readable medium containing program instructions for providing access to a resource in a programming environment supporting concurrent tasks, the program instructions for:
-
(a) providing a latch to a first task, wherein the first task requests the latch to obtain access to the resource;
(b) releasing the latch after the first task has accessed the resource, while still holding the latch;
(c) marking the latch stealable, while still holding the latch; and
(d) marking the latch unstealable if the latch is not marked stolen by a second task seeking access to the resource. - View Dependent Claims (6, 7, 8)
-
-
9. A latch mechanism for a programming environment supporting concurrent tasks, comprising:
-
means for providing a latch to a first task, whereby the first task holds the latch;
means for the first task to release the latch while holding the latch;
means for the first task to mark the latch stealable; and
means for the first task to remark the latch unstealable where the latch is not marked stolen by a second task seeking access to the latch. - View Dependent Claims (10, 11, 12, 15)
-
-
13. A computer readable medium containing program instructions for implementing an exclusive latch mechanism for associated resources in a computer programming environment supporting concurrent tasks, the program instructions for:
-
providing a latch to a requesting task, whereby the task becomes a holding task and the latch becomes a held latch, releasing the held latch, whereby the task ceases to be the holding task, marking as stealable the latch held by the holding task, the means to mark the held latch stealable comprising means to specify a flag and a cleanup subroutine, each being associated with the held latch and the holding task, and comprising means to set the flag to the value stealable, marking the held latch unstealable, the program instructions comprising;
determining the value of the flag associated with the latch, and setting the associated flag to the value unstealable, where the determined value of the flag is stealable, the program instructions for providing a latch to a requesting task, wherein the latch is a held latch, further comprising instructions for;
determining the value of the flag associated with the held latch and the holding task, and providing the held latch to the requesting task where the flag value of the held latch is stealable, the providing instructions further comprising;
executing a cleanup subroutine associated with the held latch and the holding task, and setting the flag associated with the held latch and the holding task to the value stolen.
-
-
14. A computer readable medium containing program instructions for implementing a full function latch mechanism for associated resources, the program instructions for:
-
providing a latch to a requesting task, whereby the task becomes a holding task and the latch becomes a held latch, releasing the held latch, whereby the task ceases to be the holding task, maintaining a plurality of flags, each flag in the plurality of flags being associated with the held latch and the holding task, marking the latch held by the holding task stealable, the marking instructions further comprising;
specifying a cleanup subroutine associated with the held latch and the holding task, and assigning the value stealable to the flag associated with the holding task and the held latch, and marking the latch held by the holding task unstealable, wherein the marking instructions further comprising;
determining the value of the flag associated with the holding task, indicating that the determined flag value is stealable, and setting the associated flag to the value unstealable, and determining the value of the flag associated with the holding task and for indicating that the value of the associated flag is stolen where the determined value of the flag is stolen, wherein the providing instruction further comprising instructions for providing a held latch to a requesting task, comprising;
determining the value of the flag associated with the held latch is stealable, executing a cleanup subroutine associated with the held latch and the holding task, setting the flag value to stolen, and providing the held latch to the requesting task.
-
Specification