Object locks
First Claim
1. A method for handling object locks, comprising:
- storing a thread identifier associated with a first thread in an identifier field of a lock word upon establishment of a lock on an object by the first thread, wherein the lock word further comprises an inflation field for storing a fat lock bit and a contention field for storing a contention bit; and
verifying the thread identifier stored in the identifier field and determining a state inflation and a state of contention by reading the lock word.
1 Assignment
0 Petitions
Accused Products
Abstract
A single lock word comprises an identifier field for storing a thread identifier associated with a first thread obtaining a lock on an object; an inflation field for storing a fat lock bit upon inflation of the lock on the object; and a contention field for storing a contention bit in response to an attempt by a second thread to obtain a lock on the object. The values of the single lock word are verified with a single memory fetch instruction. When unlocking an object, a single memory fetch instruction can be used to read the lock word to: (1) determine whether thread T is still the current owner of the lock, and (2) determine the states of inflation and/or contention (i.e., determine whether the fat lock and/or contention bits have been set).
28 Citations
34 Claims
-
1. A method for handling object locks, comprising:
-
storing a thread identifier associated with a first thread in an identifier field of a lock word upon establishment of a lock on an object by the first thread, wherein the lock word further comprises an inflation field for storing a fat lock bit and a contention field for storing a contention bit; and
verifying the thread identifier stored in the identifier field and determining a state inflation and a state of contention by reading the lock word. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. A method for handling object locks in a Java Virtual Machine (JVM), comprising:
-
storing a thread identifier associated with a first thread in an identifier field of a lock word upon establishment of a lock on a Java object by the first thread, wherein the lock word further comprises an inflation field for storing a fat lock bit and a contention field for storing a contention bit;
setting a contention bit in the contention field of the lock word in response to an attempt by a second thread to establish a lock on the Java object;
verifying the thread identifier stored in the identifier field and determining a state of the fat lock bit and the contention bit by reading the lock word;
releasing the lock on the Java object by the first thread; and
inflating the lock in response to determining that the contention bit has been set in the contention field. - View Dependent Claims (11, 12, 16, 22, 23)
-
-
13. A unitary lock structure, comprising:
-
an identifier field for storing a thread identifier associated with a first thread obtaining a lock on an object;
an inflation field for storing a fat lock bit upon inflation of the lock on the object; and
a contention field for storing a contention bit in response to an attempt by a second thread to obtain a lock on the object. - View Dependent Claims (14, 15)
-
-
17. A system comprising:
-
a lock engagement system for storing a thread identifier associated with a first thread in an identifier field of a lock word upon establishment of a lock on an object by the first thread, wherein the lock word further comprises an inflation field for storing a fat lock bit and a contention field for storing a contention bit;
a lock contention system for setting the contention bit in response to an attempt by a second thread to establish a lock on the object; and
a verification system for reading the lock word to verify the thread identifier stored in the identifier field and to determine a state of the fat lock bit and the contention bit. - View Dependent Claims (18, 19, 20, 21)
-
-
24. A computer program product for handling object locks, the computer program product comprising:
a computer readable medium having computer readable program code embodied therein, the computer readable program code comprising;
computer readable program code configured to store a thread identifier associated with a first thread in an identifier field of a lock word upon establishment of a lock on an object by the first thread, wherein the lock word further comprises an inflation field for storing a fat lock bit and a contention field for storing a contention bit;
computer readable program code configured to set the contention bit in response to an attempt by a second thread to establish a lock on the object; and
computer readable program code configured to read the lock word to verify the thread identifier stored in the identifier field and to determine a state of the fat lock bit and the contention bit. - View Dependent Claims (25, 26, 27, 28, 29, 30)
-
31. A system for deploying an application, comprising:
a computer infrastructure being operable to;
store a thread identifier associated with a first thread in an identifier field of a lock word upon establishment of a lock on an object by the first thread, wherein the lock word further comprises an inflation field for storing a fat lock bit and a contention field for storing a contention bit;
set the contention in response to an attempt by a second thread to establish a lock on the object; and
verify the thread identifier stored in the identifier field and determine a state of the fat lock bit and the contention bit by reading the lock word. - View Dependent Claims (32)
-
33. Computer software embodied in a propagated signal, the computer software comprising instructions to cause a computer system to perform the following functions:
-
store a thread identifier associated with a first thread in an identifier field of a lock word upon establishment of a lock on an object by the first thread, wherein the lock word further comprises an inflation field for storing a fat lock bit and a contention field for storing a contention bit;
set the contention bit in response to an attempt by a second thread to establish a lock on the object; and
verify the thread identifier stored in the identifier field and determine a state of the fat lock bit and the contention bit by reading the lock word. - View Dependent Claims (34)
-
Specification