Recyclable locking for multi-threaded computing environments
First Claim
Patent Images
1. A system comprising:
- at least one thread;
a pool of locks;
at least one object that is capable of representing a resource needed by the at least one thread, the at least one object having a variable, the variable of the at least one object comprising a set of high bits defining the pointer to a lock and a set of low bits defining a status variable; and
, a recyclable locking mechanism for associating a lock from the pool of locks with the at least one object using the variable as a pointer when requested by the at least one thread, the lock returning to the pool of locks without having to destroy the at least one object when the at least one thread no longer needs to access the resource.
2 Assignments
0 Petitions
Accused Products
Abstract
Recyclable locking for multi-threaded computing environments is disclosed. In one embodiment, a system includes at least one thread, a pool of locks, at least one object, and a recyclable locking mechanism. Each object has an associated variable. The mechanism associates a lock with an object using the associated variable of the object as a pointer, upon a first request by a thread.
26 Citations
15 Claims
-
1. A system comprising:
-
at least one thread;
a pool of locks;
at least one object that is capable of representing a resource needed by the at least one thread, the at least one object having a variable, the variable of the at least one object comprising a set of high bits defining the pointer to a lock and a set of low bits defining a status variable; and
,a recyclable locking mechanism for associating a lock from the pool of locks with the at least one object using the variable as a pointer when requested by the at least one thread, the lock returning to the pool of locks without having to destroy the at least one object when the at least one thread no longer needs to access the resource. - View Dependent Claims (2, 3, 4, 5, 6, 7)
such that upon the second request the set of low bits is decremented by 1.
-
-
8. A method comprising:
-
asserting an instruction by a thread to lock an object;
increasing a variable of the object, the variable having a set of high bits for representing a pointer to a lock and a set of low bits for representing a lock status;
determining whether the variable is greater than a boundary value so as to allocate the lock; and
recycling the lock by returning the lock to a pool of locks when the thread no longer needs the object regardless of whether the object persists after the lock returns to the pool of locks. - View Dependent Claims (9, 10, 11, 12, 13)
decrementing the variable of the object; and
, determining whether the variable is less than a minimum threshold.
-
-
13. The method of claim 12, upon determining that the variable is less than the minimum threshold, recycling the lock.
-
14. A computer comprising:
-
a processor;
a computer-readable medium; and
,a recyclable locking mechanism program executed by the processor from the computer-readable medium to associate a lock with an object using a variable of the object as a pointer when requested by a thread, the variable of the object comprising a set of high bits defining the pointer to a lock and a set of low bits defining a status variable, the lock returning to a pool of locks without having to destroy the object when the object is no longer needed by the thread.
-
-
15. A computer-readable medium having a recyclable locking mechanism program stored thereon for execution on a computer to associate a lock with an object using a variable of the object as a pointer when requested by a thread the variable of the object comprising a set of high bits defining the pointer to a lock and a set of low bits defining a status variable, the lock returning to a pool of locks without having to destroy the object when the object is no longer needed by the thread.
Specification