×

Conditional variables without spinlocks

  • US 7,770,172 B2
  • Filed: 09/01/2004
  • Issued: 08/03/2010
  • Est. Priority Date: 09/01/2004
  • Status: Expired due to Fees
First Claim
Patent Images

1. A computer system comprising:

  • a processor;

    a memory electronically coupled to the processor;

    a shared resource on the computer system protected by a mutex to regulate access to the shared resource (the mutex of the shared resource);

    multiple threads of execution that are each capable of concurrently and asynchronously accessing the shared resource to read or write data, wherein each of the multiple threads of execution are queued in a linked list of waiting threads to access the shared resource;

    a lock-free condition variable that causes each of the multiple threads of execution to wait until an event associated with the lock-free condition variable has occurred, the causing of each thread to wait occurring without locking the lock-free condition variable;

    an access bit that controls access to waiting threads;

    an awaken count that is a tally of a number of waiting threads; and

    a pointer to the linked list of waiting threads, wherein the pointer points to a head of the linked list of waiting threads, wherein the pointer is swapped within a wait function to point to a newly inserted thread in the linked list of waiting threads, and wherein the mutex of the shared resource is released such that the shared resource is freed for access by another thread within the wait function by freeing the mutex of the shared resource before any other thread is allowed to access the shared resource, the pointer being swapped and the mutex of the shared resource being released and freed in a single indivisible set of operations of the wait function.

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