×

Fair scalable reader-writer mutual exclusion

  • US 7,730,491 B2
  • Filed: 08/30/2005
  • Issued: 06/01/2010
  • 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;

    exiting the critical section by the first thread;

    removing the first queue node from the queue; and

    preventing an attempt to reference a second queue node by the first thread when the second queue node is already deleted by a second thread.

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