×

Adaptive spin-then-block mutual exclusion in multi-threaded processing

  • US 7,594,234 B1
  • Filed: 06/04/2004
  • Issued: 09/22/2009
  • Est. Priority Date: 06/04/2004
  • Status: Active Grant
First Claim
Patent Images

1. A computer-implemented method of acquiring ownership of a shared resource in a multi-threaded computing environment, comprising:

  • measuring the duration of a context switching operation within the computing environment, including in a first measuring thread, marking an initial time at which a request is generated to wake up a second measuring thread, the first measuring thread entering a sleeping state after the wake-up request is generated;

    in the second measuring thread upon being awakened, generating a request to wake up the first measuring thread; and

    in the first measuring thread, marking a finish time at which it is awakened by the request of the second thread, and calculating one-half the difference of the finish and initial times to determine the duration of the context switching operation;

    executing a spin procedure as part of an attempt by a first thread to acquire ownership of the shared resource, the spin procedure terminating upon the earlier of (i) successfully obtaining ownership of the shared resource, and (ii) reaching predetermined execution time limit equal to the measured duration of a context switching operation; and

    if the spin procedure terminates by reaching the predetermined execution time limit, then executing a blocking procedure which temporarily suspends execution of the first thread.

View all claims
  • 2 Assignments
Timeline View
Assignment View
    ×
    ×