Locking of computer resources
AssigneeSun Microsystems, Inc.
InventorsWilliam N. Joy, James Michael O'Connor, Marc Tremblay
Life of this patent
Estimating the term…
Abstract
A computer processor includes a number of register pairs LOCKADD/LOCKCOUNT to hold values identifying when a computer resource is locked. The LOCKCOUNT register is incremented or decremented in response to lock or unlock instructions, respectively. The lock is freed when a count associated with the LOCKCOUNT register is decremented to zero. In embodiments without LOCKOUT registers, the lock may be freed on any unlock instruction corresponding to the lock. In some embodiments, a computer object includes a header in which two header LSBs store: (1) a LOCK bit indicating whether the object is locked, and (2) a WANT bit indicating whether a thread is waiting to acquire a lock for the object.
Claims22
An apparatus comprising:
- a lock count register for storing a lock count value associated with a computer resource;
- and
- circuitry configured to modify the lock count value to indicate the difference between a number of lock instructions associated with the computer resource and a number of unlock instructions associated with the computer resource responsive to the occurrence of each of the lock instructions and each of the unlock instructions.
A method of managing the locking or unlocking of computer resources responsive to lock and unlock instructions, the method comprising:
- storing a first lock count value in a lock count register of a processor, the first lock count value being indicative of the difference between a number of first lock instructions associated with one computer resource of the computer resources and a number of first unlock instructions associated with the computer resource;
- and
- storing a first lock value in a lock register of the processor, the first lock value being indicative of a first lock for the computer resource.
An apparatus comprising:
- means for storing a first lock count value in a lock count register of a processor, the first lock count value being indicative of the difference between a number of first lock instructions associated with one computer resource of the plurality of computer resources and a number of first unlock instructions associated with the computer resource;
- and
- means for storing a first lock value in a lock register of the processor, the first lock value being indicative of a first lock for the computer resource.
Dependencies are inferred from the claim text.