×

Fair scalable reader-writer mutual exclusion

  • US 8,707,324 B2
  • Filed: 02/27/2012
  • Issued: 04/22/2014
  • 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 comprising:

  • creating a first queue node for a first thread of a plurality of processing threads executing on a processor, the first queue node representing a request by the first thread to access the critical section;

    setting at least one pointer within a queue to point to the first queue node, the queue representing at least one thread desiring access to the critical section, the first queue node being added to a tail of the queue;

    waiting until a condition is met, the condition comprising the first queue node having no preceding write requests as indicated by at least one predecessor queue node on the queue;

    permitting the first thread to enter the critical section in response to the condition being met;

    causing the first thread to release a spin lock, the spin lock acquired by a second thread of the plurality of processing threads, wherein each queue node in the queue is one of a reader queue node or a writer queue node; and

    if the first thread is a reader thread, examining the tail of the queue by the reader thread in response to the reader thread wanting to acquire a lock on a reader writer mutex for the critical section;

    if the tail of the queue points to a writer queue node;

    setting a spin lock for the first queue node to true; and

    changing a qNext pointer of a predecessor queue node in the queue to point to the first queue node.

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