IP Library Granted Patent US 7,765,555
Granted Patent B2
US 7,765,555 · App. 11/353,537 · Granted Jul 27, 2010

Facilitating bulk lock-unbiasing in an object-based system

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,765,555
App. No.
11/353,537
Granted
Jul 27, 2010
Kind
B2
Abstract

One embodiment of the present invention provides a system that facilitates bulk lock-unbiasing for objects within an object-based computing system. The system maintains an epoch, which is a field containing a timestamp, for a biasable object class and each instance of the biasable object class. If the epoch for the biasable object class matches the epoch for a specific instance of the biasable object class, the system knows that any bias for that specific instance is currently valid. When the system receives a signal to perform a bulk lock-unbiasing operation for instances of the biasable object class, it responds by stopping all threads in the object-based computing system at a safe point. Then, the system performs a bulk lock-unbiasing operation for unlocked instances of the biasable object class by incrementing the epoch for the biasable object class and by incrementing corresponding epochs for locked instances of the biasable object class.

Claims (59)

1. A method for facilitating bulk lock-unbiasing for objects within an object-based computing system, comprising:

maintaining an epoch for a biasable object class and each instance of the biasable object class, wherein the epoch is a field containing a timestamp;

wherein if the epoch for the biasable object class matches the epoch for a specific instance of the biasable object class, any bias for the specific instance is currently valid;

receiving a signal to perform a bulk lock-unbiasing operation for instances of the biasable object class;

in response to the signal, stopping all threads in the object-based computing system at a safe point, and

performing a bulk lock-unbiasing operation for unlocked instances of the biasable object class by incrementing the epoch for the biasable object class and by incrementing corresponding epochs for locked instances of the biasable object class; and

upon encountering a lock-acquisition operation while executing a current thread, wherein the lock-acquisition operation attempts to acquire a lock for the specific instance,

examining synchronization information associated with the specific instance, wherein the process of examining the synchronization information does not involve atomic operations, and

if the synchronization information indicates that the lock is biasable, the lock is biased toward the current thread, and the epoch of the specific instance matches the epoch of the biasable object class, allowing the current thread to acquire the lock without updating the synchronization information.

2. The method of claim 1 , wherein incrementing the epoch for locked instances involves:

searching the stack of the thread to identify instances of the biasable object class which are locked by the thread; and

updating the epochs for the identified locked instances by incrementing the epoch values associated with the instances.

3. The method of claim 1 , wherein maintaining the epoch for the biasable object class involves storing the epoch in a prototype header located in the metadata of the biasable object class.

4. The method of claim 1 , wherein if the synchronization information indicates that the lock is biasable and the lock is presently unbiased, or that the lock is biasable but the epoch of the specific instance does not match the epoch of the biasable object class, the method further comprises:

using an atomic operation to attempt to update the synchronization information to indicate that the lock is biased toward the current thread in the current epoch of the biasable object class; and

if the atomic operation succeeds, allowing the current thread to acquire the lock.

5. The method of claim 4 , wherein if the synchronization information indicates that the lock is biasable, the lock is biased towards another thread, and the epoch of the specific instance matches the epoch of the biasable object class, the method further comprises revoking the bias of the lock.

6. The method of claim 5 , wherein if the atomic operation fails, the bias of the lock is revoked, or the synchronization information indicates that the lock is not biasable, the method further comprises using an underlying synchronization technique to acquire the lock.

7. The method of claim 4 , wherein the prototype header is used to construct a value to be compared with synchronization information associated with the specified instance using a single XOR operation.

8. The method of claim 7 , wherein the synchronization information associated with the object is contained within a synchronization word within the object.

9. The method of claim 1 , wherein the method further comprises:

estimating a rate of bias revocation on a per-object-class basis; and

if the estimated rate of bias revocation for a given object class exceeds a threshold value, performing either a bulk unbias or a bulk revocation for all instances of the given object class.

10. A computer-readable storage medium storing instructions that when executed by a computer cause the computer to perform a method for facilitating bulk lock-unbiasing for objects within an object-based computing system, comprising:

maintaining an epoch for a biasable object class and each instance of the biasable object class, wherein the epoch is a field containing a timestamp;

wherein if the epoch for the biasable object class matches the epoch for a specific instance of the biasable object class, any bias for the specific instance is currently valid;

receiving a signal to perform a bulk lock-unbiasing operation for instances of the biasable object class;

in response to the signal, stopping all threads in the object-based computing system at a safe point, and

performing a bulk lock-unbiasing operation for unlocked instances of the biasable object class by incrementing the epoch for the biasable object class and by incrementing corresponding epochs for locked instances of the biasable object class; and

upon encountering a lock-acquisition operation while executing a current thread, wherein the lock-acquisition operation attempts to acquire a lock for the specific instance,

examining synchronization information associated with the specific instance, wherein the process of examining the synchronization information does not involve atomic operations, and

if the synchronization information indicates that the lock is biasable, the lock is biased toward the current thread, and the epoch of the specific instance matches the epoch of the biasable object class, allowing the current thread to acquire the lock without updating the synchronization information.

11. The computer-readable storage medium of claim 10 , wherein incrementing the epoch for locked instances involves:

searching the stack of the thread to identify instances of the biasable object class which are locked by the thread; and

updating the epochs for the identified locked instances by incrementing the epoch values associated with the instances.

12. The computer-readable storage medium of claim 10 , wherein maintaining the epoch for the biasable object class involves storing the epoch in a prototype header located in the metadata of the biasable object class.

13. The computer-readable storage medium of claim 10 , wherein if the synchronization information indicates that the lock is biasable and the lock is presently unbiased, or that the lock is biasable but the epoch of the specific instance does not match the epoch of the biasable object class, the method further comprises:

using an atomic operation to attempt to update the synchronization information to indicate that the lock is biased toward the current thread in the current epoch of the biasable object class; and

if the atomic operation succeeds, allowing the current thread to acquire the lock.

14. The computer-readable storage medium of claim 13 , wherein if the synchronization information indicates that the lock is biasable, the lock is biased towards another thread, and the epoch of the specific instance matches the epoch of the biasable object class, the method further comprises revoking the bias of the lock.

15. The computer-readable storage medium of claim 14 , wherein if the atomic operation fails, the bias of the lock is revoked, or the synchronization information indicates that the lock is not biasable, the method further comprises using an underlying synchronization technique to acquire the lock.

16. The computer-readable storage medium of claim 13 , wherein the prototype header is used to construct a value to be compared with synchronization information associated with the specified instance using a single XOR operation.

17. The computer-readable storage medium of claim 16 , wherein the synchronization information associated with the object is contained within a synchronization word within the object.

18. The computer-readable storage medium of claim 10 , wherein the method further comprises:

estimating a rate of bias revocation on a per-object-class basis; and

if the estimated rate of bias revocation for a given object class exceeds a threshold value, performing either a bulk unbias or a bulk revocation for all instances of the given object class.

19. An apparatus for facilitating bulk lock-unbiasing for objects within an object-based computing system, comprising:

at least one processor;

a maintenance mechanism configured to maintain an epoch for a biasable object class and each instance of the biasable object class, wherein the epoch is a field containing a timestamp;

wherein if the epoch for the biasable object class matches the epoch for a specific instance of the biasable object class, any bias for the specific instance is currently valid;

a receiving mechanism configured to receive a signal to perform a bulk lock-unbiasing operation for instances of the biasable object class;

a stop mechanism configured to, in response to the signal, stop all threads in the object-based computing system at a safe point; and

an incrementing mechanism configured to perform a bulk lock-unbiasing operation for unlocked instances of the biasable object class by incrementing the epoch for the biasable object class and by incrementing corresponding epochs for locked instances of the biasable object class; and

a lock-acquisition mechanism, wherein upon encountering a lock-acquisition operation while executing a current thread, the lock-acquisition mechanism is configured to attempt to acquire a lock for the specific instance by,

examining synchronization information associated with the specific instance, wherein the process of examining the synchronization information does not involve atomic operations, and

if the synchronization information indicates that the lock is biasable, the lock is biased toward the current thread, and the epoch of the specific instance matches the epoch of the biasable object class, allowing the current thread to acquire the lock without updating the synchronization information.

20. The apparatus of claim 19 , wherein the incrementing mechanism that increments the epoch for locked instances further comprises:

a search mechanism that searches the stack of the thread to identify instances of the biasable object class which are locked by the thread; and

an update mechanism that updates the epochs for the identified locked instances by incrementing the epoch values associated with the instances.

Assignments (2)
MERGER AND CHANGE OF NAME Recorded Dec 16, 2015
From: ORACLE USA, INC.; SUN MICROSYSTEMS, INC.; ORACLE AMERICA, INC.
To: ORACLE AMERICA, INC.
Reel/Frame 037306/0514 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 14, 2006
From: DETLEFS. DAVID L.; RUSSELL, KENNETH B.
To: SUN MICROSYSTEMS, INC.
Reel/Frame 017576/0385 →