Facilitating biased synchronization in an object-based system
First Claim
1. A method for facilitating biased locking of objects within an object-based computing system, comprising:
- encountering a lock-acquisition operation while executing a current thread, wherein the lock-acquisition operation attempts to acquire a lock for an object;
in response to the lock-acquisition operation, examining synchronization information associated with the object, wherein the process of examining the synchronization information does not involve atomic operations;
if the synchronization information indicates that the lock is biasable and that the lock is biased toward the current thread, allowing the current thread to acquire the lock without updating the synchronization information; and
if the synchronization information indicates that the lock is biasable and that the lock is biased toward another thread revoking the bias toward the other thread by;
stopping all threads in the object-based computing system at a safe point;
determining whether the lock is held by the other thread;
if not, resetting the synchronization information to indicate that the lock is biasable but unbiased whereby the lock can be subsequently rebiased; and
if the lock is held, resetting the synchronization information to indicate that the lock is not biasable, and falling back to an underlying synchronization technique to acquire the lock, and also updating the synchronization information to reflect the locking state of the object in the underlying synchronization technique;
wherein acquiring the lock for the object without atomic operations reduces the number of hardware operations the current thread needs to execute on the object-based computing system to acquire the lock.
2 Assignments
0 Petitions
Accused Products
Abstract
One embodiment of the present invention provides a system that facilitates biased locking of objects within an object-based computing system. The system encounters a lock-acquisition operation while executing a current thread, wherein the lock-acquisition operation attempts to acquire a lock for an object. In response to the lock-acquisition operation, the system examines synchronization information associated with the object, wherein the process of examining the synchronization information does not involve atomic operations. If the synchronization information indicates that the lock is biasable and that the lock is biased toward the current thread, the system allows the current thread to acquire the lock without updating the synchronization information.
-
Citations
18 Claims
-
1. A method for facilitating biased locking of objects within an object-based computing system, comprising:
-
encountering a lock-acquisition operation while executing a current thread, wherein the lock-acquisition operation attempts to acquire a lock for an object; in response to the lock-acquisition operation, examining synchronization information associated with the object, wherein the process of examining the synchronization information does not involve atomic operations; if the synchronization information indicates that the lock is biasable and that the lock is biased toward the current thread, allowing the current thread to acquire the lock without updating the synchronization information; and if the synchronization information indicates that the lock is biasable and that the lock is biased toward another thread revoking the bias toward the other thread by; stopping all threads in the object-based computing system at a safe point; determining whether the lock is held by the other thread; if not, resetting the synchronization information to indicate that the lock is biasable but unbiased whereby the lock can be subsequently rebiased; and if the lock is held, resetting the synchronization information to indicate that the lock is not biasable, and falling back to an underlying synchronization technique to acquire the lock, and also updating the synchronization information to reflect the locking state of the object in the underlying synchronization technique; wherein acquiring the lock for the object without atomic operations reduces the number of hardware operations the current thread needs to execute on the object-based computing system to acquire the lock. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A computer-readable storage medium storing instructions that when executed by a computer cause the computer to perform a method for facilitating biased locking of objects within an object-based computing system, the method comprising:
-
encountering a lock-acquisition operation while executing a current thread, wherein the lock-acquisition operation attempts to acquire a lock for an object; in response to the lock-acquisition operation, examining synchronization information associated with the object, wherein the process of examining the synchronization information does not involve atomic operations; if the synchronization information indicates that the lock is biasable and that the lock is biased toward the current thread, allowing the current thread to acquire the lock without updating the synchronization information; and if the synchronization information indicates that the lock is biasable and that the lock is biased toward another thread revoking the bias toward the other thread by; stopping all threads in the object-based computing system at a safe point; determining whether the lock is held by the other thread; if not, resetting the synchronization information to indicate that the lock is biasable but unbiased, whereby the lock can be subsequently rebiased; and if the lock is held, resetting the synchronization information to indicate that the lock is not biasable, and falling back to an underlying synchronization technique to acquire the lock, and also updating the synchronization information to reflect the locking state of the object in the underlying synchronization technique; wherein acquiring the lock for the object without atomic operations reduces the number of hardware operations the current thread needs to execute on the object-based computing system to acquire the lock. - View Dependent Claims (10, 11, 12, 13, 14, 15, 16)
-
-
17. An apparatus for facilitating biased locking of objects within an object-based computing system, comprising:
-
a lock-acquisition mechanism; wherein when a lock-acquisition operation is executed by a current thread, the lock-acquisition mechanism is configured to examine synchronization information associated with the object, wherein the process of examining the synchronization information does not involve atomic operations; wherein if the synchronization information indicates that the lock is biasable and that the lock is biased toward the current thread, the lock-acquisition mechanism is configured to allow the current thread to acquire the lock without updating the synchronization information; and wherein if the synchronization information indicates that the lock is biasable and that the lock is biased toward another thread, the lock-acquisition mechanism is configured to revoke the bias toward the other thread by; stopping all threads in the object-based computing system at a safe point; determining whether the lock is held by the other thread; if not, resetting the synchronization information to indicate that the lock is biasable but unbiased, whereby the lock can be subsequently rebiased; and if the lock is held, resetting the synchronization information to indicate that the lock is not biasable, and falling back to an underlying synchronization technique to acquire the lock, and also updating the synchronization information to reflect the locking state of the object in the underlying synchronization technique; wherein acquiring the lock for the object without atomic operations reduces the number of hardware operations the current thread needs to execute on the object-based computing system to acquire the lock. - View Dependent Claims (18)
-
Specification