×

Busy-wait-free synchronization

  • US 6,173,442 B1
  • Filed: 02/05/1999
  • Issued: 01/09/2001
  • Est. Priority Date: 02/05/1999
  • 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 execution of multiple execution threads, produces electrical signals representing object code that for each thread directs a processor to allocate an execution environment that includes a successor-identifier field, a release-value-reception field, and a release-value-transmission field;

    B) in response to electrical signals representing source code that calls for allocation of an object on which thread execution can be synchronized, produces electrical signals representing object code that directs a processor to allocate to the object an object structure that includes an identifier field and a synchronization-state field; and

    C) in response to electrical signals representing source code that calls for a synchronizing execution thread to perform any one of a set of at least one monitor-access operation with respect to the object, produces electrical signals representing object code that directs a processor to perform a monitor-access operation that;

    i) begins with a meta-lock-acquisition operation in which the synchronizing execution thread;

    a) performs an atomic swap operation in which the synchronizing execution thread swaps pre-acquisition identifier-field and synchronization-state-field contents for an identifier of the synchronizing execution thread and a predetermined busy code; and

    b) if the pre-acquisition synchronization-state-field contents are the busy code, performs a slow-meta-lock operation in which the synchronizing execution thread copies a release value from the release-value-reception field of the synchronizing execution thread'"'"'s execution environment or from the release-value-transmission field of a predecessor thread'"'"'s execution environment;

    ii) produces a release value by executing in accordance with the pre-acquisition synchronization-state-field contents if the pre-acquisition synchronization-state-field contents are not the busy code and by otherwise executing in accordance with the copied release value; and

    iii) ends with a meta-lock-release operation, in which the synchronizing execution thread;

    a) performs an atomic compare-and-swap operation that;

    (1) is successful, replacing pre-release contents of the object'"'"'s identifier field and replacing pre-release contents of the object'"'"'s synchronization-state field with a synchronization-state code other than the busy code, if the pre-release contents of the object'"'"'s identifier field identify the synchronizing execution thread and the pre-release contents of the object'"'"'s synchronization-state field are the busy code; and

    (2) is otherwise unsuccessful and does not replace the pre-release contents of the object'"'"'s identifier and synchronization-state fields; and

    b) if the atomic compare-and-swap operation is unsuccessful, performs a slow-meta-lock-release operation, in which the synchronizing execution thread makes a determination of whether the contents of a successor-identifier field in its execution environment identify a successor thread and;

    (1) if so, places a release value in the release-value-reception field of the successor thread'"'"'s execution environment; and

    (2) if not, places the release value in the release-value-transmission field of its own execution environment.

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