Mechanism for managing the locking and unlocking of objects in Java
First Claim
1. A mechanism for managing the locking and unlocking of an object by a thread, said mechanism comprising:
- (a) a transition vector having a plurality of ordered transition elements, each of said plurality of ordered transition-elements being separate from, and not part of, the object or a data structure of the object;
(b) a reference element for referencing one of the transition elements in said transition vector, and said reference element being accessible in the object;
(c) each of said transition elements including locking means for locking the object and unlocking means for unlocking the object;
(d) said locking means having means for assigning said reference element to the next transition element in response to a locking request for the object by the thread; and
(e) said unlocking means having means for assigning said reference element to the previous element in response to an unlocking request for the object by the thread.
2 Assignments
0 Petitions
Accused Products
Abstract
A mechanism for managing the locking and unlocking of objects. The mechanism comprises a transition vector having an ordered set of transition elements. Each of the transition elements includes a locking function or a pointer to the locking function and an unlocking function or a pointer to the unlocking function. When an object is created a transition vector is assigned to the object. The object includes a reference element which references a transition element in the vector. In response to a request to lock the object, the locking function in the transition element is invoked and the next transition element is assigned to the object and the reference element in the object is updated. For a request to unlock the object, the unlocking function in the transition element is invoked and the previous transition element is assigned to the object and the reference element is updated. The mechanism improves execution overhead by providing an implicit count for determining the lock count on an object. The mechanism also features typed transition vectors for structured locking/unlocking and unstructured locking/unlocking operations.
55 Citations
23 Claims
-
1. A mechanism for managing the locking and unlocking of an object by a thread, said mechanism comprising:
-
(a) a transition vector having a plurality of ordered transition elements, each of said plurality of ordered transition-elements being separate from, and not part of, the object or a data structure of the object;
(b) a reference element for referencing one of the transition elements in said transition vector, and said reference element being accessible in the object;
(c) each of said transition elements including locking means for locking the object and unlocking means for unlocking the object;
(d) said locking means having means for assigning said reference element to the next transition element in response to a locking request for the object by the thread; and
(e) said unlocking means having means for assigning said reference element to the previous element in response to an unlocking request for the object by the thread. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 20, 21, 23)
-
-
13. A method for managing the locking and unlocking of an object by a thread, said method utilizing a transition vector comprising an ordered set of transition elements and each of said transition elements comprising a structure having first and second function pointers, said first function pointer referencing a locking function for locking said object and said second function pointer referencing an unlocking function for unlocking said object, said method comprising the steps of:
-
(a) assigning a transition vector to an object when the object is created, wherein a reference element in the object is assigned to the first transition element in the transition vector;
(b) invoking the locking function in the currently referenced transition element in response to a request from the thread to lock the object, and assigning said reference element to the next transition element in the transition vector;
(c) invoking the unlocking function in the currently assigned transition element in response to a request from the thread to unlock the object, and assigning said reference element to the previous transition element in the transition vector;
(d) generating an exception in step (c) if a request is made by a thread to unlock an object which has not been locked, wherein each of the transition elements in the ordered set of transition elements is separate from, and not part of, the object or a data structure of the object. - View Dependent Claims (14, 15, 16, 17, 18, 19, 22)
-
Specification