Locking of computer resources

Electrical computers and digital data processing systems: input/ – Access locking

Reexamination Certificate

Rate now

  [ 0.00 ] – not rated yet Voters 0   Comments 0

Details

C710S108000

Reexamination Certificate

active

06529982

ABSTRACT:

BACKGROUND OF THE INVENTION
The present invention relates to locking of computer resources.
When different computer entities such as computer processes or threads share a computer resource (for example, data, code, or a piece of hardware), it may be desirable to allow one of the computer entities to lock a resource for a while to prevent some types of access to the resource by other computer entities. For example, if two or more threads share computer data, and one thread has started but not finished to modify the data when another thread is accessing the data, the other thread may get incorrect information from the data and/or the data could be corrupted by the two threads. Also, if one thread has started but not finished execution of a critical code section when another thread starts executing the same code section, execution errors may occur if, for example, the critical code section modifies the state of a data area, a hardware controller, or some other computer resource. Therefore, locking techniques have been provided to allow computer entities to lock computer resources.
It is desirable to provide fast techniques for locking of computer resources.
SUMMARY
The present invention provides methods and circuits that allow locking and unlocking of computer resources to be fast in many frequently occurring situations. In particular, in some embodiments, locking is typically fast when there is no contention for the lock (that is, the lock is not being held by another computer entity). Locking operations are also typically fast when the same computer entity, for example, the same thread, performs multiple lock operations on the same lock before the thread frees the lock. Multiple lock operations before the lock is freed can occur if the thread executes recursive code.
In some embodiments, the above advantages are achieved as follows. A computer processor includes a number of register pairs (LOCKADDR, LOCKCOUNT). Each LOCKADDR register is to hold a value that identifies a lock for a computer resource. In some embodiments, this value is a reference to a locked object. Thus, in some embodiments, the value is an address of a locked object. The corresponding LOCKCOUNT register holds the count of lock instructions associated with the lock identified by the LOCKADDR register. When a thread issues a lock instruction for the lock identified by the LOCKADDR register, the computer processor increments the corresponding LOCKCOUNT register. When the thread issues an unlock instruction, the computer processor decrements the corresponding LOCKCOUNT register.
In some embodiments, the processor is suitable for executing the lock and unlock instructions of the Java Virtual Machine. The Java Virtual Machine is described, for example, in T. Lindholm, F. Yellin, “The Java® Virtual Machine Specification” (1997). In the Java Virtual Machine, each object has a monitor associated with it. When a thread executes a lock instruction “monitorenter”, a counter associated with the corresponding monitor is incremented. When the thread executes the unlock instruction “monitorexit”, the counter is decremented. In some embodiments, the counters are implemented using the LOCKCOUNT registers.
In some embodiments, the LOCKCOUNT registers are omitted, and the lock for a resource is freed on any unlock instruction issued for the resource.
In some embodiments, each object includes a header which is a pointer to a class structure. The class structure is aligned on a 4-byte boundary, and hence the two LSBs of the pointer are zero and need not be stored in the header. Instead, the two LSBs of the header are used to 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.
Other features and advantages of the invention are described below. The invention is defined by the appended claims.


REFERENCES:
patent: 4435766 (1984-03-01), Haber et al.
patent: 4858116 (1989-08-01), Gillett, Jr. et al.
patent: 5117352 (1992-05-01), Falek
patent: 5261108 (1993-11-01), Hayashi et al.
patent: 5263161 (1993-11-01), Barth et al.
patent: 5321825 (1994-06-01), Song
patent: 5341491 (1994-08-01), Ramanujan
patent: 5375241 (1994-12-01), Walsh
patent: 5377352 (1994-12-01), Tanaka et al.
patent: 5404482 (1995-04-01), Stamm et al.
patent: 5442755 (1995-08-01), Shibata
patent: 5535365 (1996-07-01), Barriuso et al.
patent: 5555393 (1996-09-01), Tanaka et al.
patent: 5574922 (1996-11-01), James
patent: 5592673 (1997-01-01), Kurabayashi et al.
patent: 5594907 (1997-01-01), Tanaka
patent: 5615167 (1997-03-01), Jain et al.
patent: 5623673 (1997-04-01), Gephardt et al.
patent: 5669002 (1997-09-01), Buch
patent: 5737545 (1998-04-01), Wszolek et al.
patent: 5872980 (1999-02-01), Derrick et al.
patent: 5875485 (1999-02-01), Matsumoto
patent: 5893156 (1999-04-01), Matsumoto
patent: 0 567 355 (1993-10-01), None
Catanzaro, B., Multiprocessor System Architectures (SunSoft Press 1994), pp. 251-253.
Lindholm, T. and Yellin, F., The Java™Virtual Machine Specification (Addison-Wesley 1997).
Wayner, P., “Sun Gambles on Java Chips,”Byte,Nov. 1996, pp. 79-82, 84, 86, and 88.

LandOfFree

Say what you really think

Search LandOfFree.com for the USA inventors and patents. Rate them and share your experience with other people.

Rating

Locking of computer resources does not yet have a rating. At this time, there are no reviews or comments for this patent.

If you have personal experience with Locking of computer resources, we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Locking of computer resources will most certainly appreciate the feedback.

Rate now

     

Profile ID: LFUS-PAI-O-3083839

  Search
All data on this website is collected from public sources. Our data reflects the most accurate information available at the time of publication.