Fair scalable reader-writer mutual exclusion
First Claim
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.
0 Assignments
0 Petitions
Accused Products
Abstract
Implementing fair scalable reader writer mutual exclusion for access to a critical section by a plurality of processing threads is accomplished by creating a first queue node for a first thread, 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; 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; and causing the first thread to release a spin lock, the spin lock acquired by a second thread of the plurality of processing threads.
27 Citations
27 Claims
-
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 Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. An article comprising:
- a machine accessible non-transitory storage medium containing instructions, which when executed, result implementing fair scalable reader writer mutual exclusion for access to a critical section by;
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 Dependent Claims (11, 12, 13, 14, 15, 16, 17, 18)
- a machine accessible non-transitory storage medium containing instructions, which when executed, result implementing fair scalable reader writer mutual exclusion for access to a critical section by;
-
19. A computer system comprising:
-
a processor to execute a plurality of processing threads; and a memory coupled to the processor, the memory to store a single word reader writer mutex to point to a queue representing at least one thread desiring access to a critical section; wherein the processor is further configured to;
create a first queue node in a first region of the memory, the first queue node representing a request by the first thread to access the critical section;
set at least one pointer within the queue to point to the first queue node, the first queue node being added to a tail of the queue;
wait 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;
permit the first thread to enter the critical section in response to the condition being met; and
cause the first thread to release a 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; andif the first thread is a reader thread, examine 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; set a spin lock for the first queue node to true; and change a qNext pointer of a predecessor queue node in the queue to point to the first queue node. - View Dependent Claims (20, 21, 22, 23, 24, 25, 26, 27)
-
Specification