×

Fair scalable reader-writer mutual exclusion

  • US 8,127,303 B2
  • Filed: 05/18/2010
  • Issued: 02/28/2012
  • Est. Priority Date: 08/30/2005
  • Status: Active Grant
First Claim
Patent Images

1. A computer-implemented method of implementing fair scalable reader writer mutual exclusion for access to a critical section of a memory coupled to a processor comprising:

  • creating a first queue node for a first thread of a plurality of processing threads executing on the processor, wherein the first queue node is created in a first region of the memory allocated for a stack of the first thread, the first queue node representing a request by the first thread to access the critical section;

    adding the first queue node to a queue pointed to by a single word reader writer mutex for the critical section by setting pointers within the queue to point to the first queue node, the queue representing a list of threads desiring access to the critical section, each queue node in the queue being in a region of the memory allocated for a stack of a thread of the plurality of processing threads, the first queue node being added to a tail of the queue;

    waiting until a condition is met, the condition being that the first queue node has no preceding write requests as indicated by predecessor queue nodes on the queue;

    entering the critical section by the first thread when the condition is met;

    releasing a spin lock by the first thread, the spin lock acquired by a second thread of the plurality of processing threads; and

    exiting the critical section by the first thread.

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