Method and apparatus for concurrent thread synchronization
First Claim
1. A computer-implemented method for obtaining a header value of an object using a first thread, the object including an object header, the first thread having an associated execution stack and having a first thread execution priority, the method comprising:
- a) replacing contents of the object header with a sentinel which identifies the stack;
b) determining whether the contents include a header value of the object; and
c) when it is determined that the contents do not include the header value of the object, determining when the object is being studied by a second thread.
2 Assignments
0 Petitions
Accused Products
Abstract
Methods and apparatus for locking and unlocking objects using synchronized threads are disclosed. According to one aspect of the present invention, a computer-implemented method for using a first thread to obtain a header value of an object includes replacing contents of a header of the object with a sentinel which identifies an execution stack associated with the first thread. Once the object contents are replaced with the sentinel, a determination is made regarding whether the object contents include a header value of the object, and when it is determined that the object contents do not include the header value of the object, a determination is made as to when the object is in the process of being studied by a second thread. In one embodiment, when it is determined that the object is not in the process of being studied by the second thread, the method involves adding the first thread to a list associated with the stack.
-
Citations
26 Claims
-
1. A computer-implemented method for obtaining a header value of an object using a first thread, the object including an object header, the first thread having an associated execution stack and having a first thread execution priority, the method comprising:
-
a) replacing contents of the object header with a sentinel which identifies the stack; b) determining whether the contents include a header value of the object; and c) when it is determined that the contents do not include the header value of the object, determining when the object is being studied by a second thread. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10)
-
-
11. A computer-implemented method for returning a header value of an object to the object, the header value being stored on an execution stack associated with a first thread, the object including an object header, the first thread having a first thread execution priority, the method comprising:
-
a) exchanging contents of the object header for a sentinel arranged to identify the execution stack; and b) using the contents to determine if the object is being studied by a second thread; and c) when it is determined that the object is not being studied by the second thread, replacing the sentinel with the header value. - View Dependent Claims (12, 13, 14)
-
-
15. A computer program product for associating an object with a first thread, the object including an object header, the first thread having an associated stack allocated in a memory associated with a computer system, the computer program product comprising:
-
computer code that obtains contents of the object header; and computer code that stores the contents of the object header at a first location within the stack; computer code that stores a reference indicator in the object header, the reference indicator being arranged to identify the stack; computer code that determines when the contents of the object header do not include a header value; computer code that determines when the object is in the process of being studied by a second thread when the contents of the object header do not include the header value; and a computer readable medium that stores the computer codes. - View Dependent Claims (16, 17, 18, 19, 20, 21, 22)
-
-
23. A computer system including a memory which includes a plurality of threads, each of the plurality of threads having an associated stack, the computer system comprising:
-
a processor coupled to the memory; and an object including an object header, the object header being arranged to contain a header value which includes information relating to the object, wherein a first thread selected from the plurality of threads is arranged to obtain the header value and to place a first reference indicator in the object header, the first reference indicator being arranged to identify the stack associated with the first thread; and a second thread selected from the plurality of threads, the second thread being arranged to obtain the reference indicator from the object header and to use the reference indicator to determine that the object is not available to the second thread. - View Dependent Claims (24, 25, 26)
-
Specification