Method and apparatus for thread synchronization in an object-based system
First Claim
1. A computer-implemented method for unlocking an object using a first thread, the object including an object header field, the first thread having an associated first stack, wherein the object is locked by the first thread, the method comprising:
- a) obtaining contents of the object header field;
b) determining when the object is locked recursively; and
c) when it is determined that object is locked recursively, removing an indicator value from the first stack, wherein the indicator value is arranged to indicate that the object is locked recursively.
2 Assignments
0 Petitions
Accused Products
Abstract
Methods and apparatus which enable threads to lock and to unlock objects disclosed. According to one aspect of the present invention, a method for associating an object with a first thread includes obtaining the contents of the object header field of the object. The contents obtained from the object header field are then stored into a first location within a stack which is associated with the first thread. A reference indicator, which identifies the stack in which the contents obtained from the object header field are stored, is then stored in the object header field. In one embodiment, the method further includes updating a status indicator associated with the object to essentially show that the reference indicator is stored in the object header field. In such an embodiment, the contents of the object header may include a header value, and the status indicator may be updated to indicate that the object is accessible to the first thread.
67 Citations
6 Claims
-
1. A computer-implemented method for unlocking an object using a first thread, the object including an object header field, the first thread having an associated first stack, wherein the object is locked by the first thread, the method comprising:
-
a) obtaining contents of the object header field;
b) determining when the object is locked recursively; and
c) when it is determined that object is locked recursively, removing an indicator value from the first stack, wherein the indicator value is arranged to indicate that the object is locked recursively. - View Dependent Claims (2)
-
-
3. A computer system for unlocking an object using a first thread, the object including an object header field, the first thread having an associated first stack, wherein the object is locked by the first thread, the computer system comprising:
-
a first mechanism for obtaining contents of the object header field;
a second mechanism for determining when the object is locked recursively; and
a third mechanism for removing an indicator value from the first stack when it is determined that the object is locked recursively, wherein the indicator value is arranged to indicate that the object is locked recursively. - View Dependent Claims (4)
-
-
5. A computer program product for unlocking an object using a first thread, the object including an object header field, the first thread having an associated first stack, wherein the object is locked by the first thread, the computer program product comprising:
-
computer code that obtains the contents of the object header field;
computer code that determined when the object is locked recursively;
computer code that removes an indicator value from the first stack when it is determined that the object is locked recursively, wherein the indicator value is arranged to indicate that the object is locked recursively; and
a computer-readable medium that stores the computer codes. - View Dependent Claims (6)
-
Specification