×

Relaxed lock protocol

  • US 6,735,760 B1
  • Filed: 11/08/2000
  • Issued: 05/11/2004
  • Est. Priority Date: 11/08/2000
  • Status: Expired due to Fees
First Claim
Patent Images

1. A computer system configured by computer instructions to operate as a compiler/interpreter that:

  • A) in response to electrical signals representing source code that calls for an execution thread to lock an object for which there has been allocated an object structure that includes synchronization information that indicates whether the object'"'"'s monitor has been inflated, and, if so, identifies a monitor record, thereby associated with the object, that includes a reference count and a lock indicator that indicates whether the object is locked, produces electrical signals representing object code that directs a processor to perform a lock operation by;

    i) reading the synchronization information in the object structure;

    ii) if the synchronization information thereby read does not indicate that the object has been inflated, inflating the object'"'"'s monitor by so changing the synchronization information in the object structure as to make the synchronization information indicate that the object'"'"'s monitor is inflated and associate with that object a monitor record whose lock indicator indicates that the object is locked; and

    iii) if the synchronization information does indicate that the object'"'"'s monitor has been inflated and identifies a monitor record whose lock indicator indicates that the object has been locked, a) incrementing that monitor'"'"'s reference count to indicate that the thread is waiting for the object; and

    b) repeatedly rereading the synchronization information, and reading the monitor record'"'"'s lock indicator if the synchronization indicator still associates the same monitor record with the object, until;

    (1) the synchronization indicator no longer associates the same monitor record with the object, in which case the thread recommences the lock operation, or;

    (2) the lock indicator no longer indicates that the object is locked, in which case the thread locks the object by making the lock indicator indicate that the object is again locked; and

    B) in response to electrical signals representing source code that calls for an execution thread to unlock the object, produces electrical signals representing object code that directs a processor to perform an unlock operation in which the thread;

    i) reads the reference count in the monitor record associated with the object; and

    ii) if the reference count indicates that no other thread is waiting for the object;

    a) changes the object'"'"'s synchronization information to indicate that the object'"'"'s monitor is not inflated without confirming atomically with the synchronization-information change that the reference count still indicates that no further thread is waiting for the object;

    b) re-reads the reference count in the monitor record associated with the object; and

    c) if the reference count indicates that another thread is waiting for the object causing that other thread to recommence the lock operation.

View all claims
  • 1 Assignment
Timeline View
Assignment View
    ×
    ×