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 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.
1 Assignment
0 Petitions
Accused Products
Abstract
Implementing fair scalable reader writer mutual exclusion for access to a critical section by a plurality of processing threads in a processing system is accomplished by creating a first queue node for a first thread on the first thread'"'"'s stack, the 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, the queue representing a list of threads desiring access to the critical section, each queue node in the queue being on a stack of a thread of the plurality of processing threads; waiting until 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; exiting the critical section by the first thread; and removing the first queue node from the queue.
-
Citations
21 Claims
-
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 Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. An article comprising:
- a machine accessible non-transitory storage medium containing instructions, which when executed, result in implementing fair scalable reader writer mutual exclusion for access to a critical section of a memory coupled to a processor by a plurality of processing threads executing on the processor by
creating a first queue node for a first thread of the plurality of processing threads, 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 of the processing system 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 Dependent Claims (9, 10, 11, 12, 13, 14)
- a machine accessible non-transitory storage medium containing instructions, which when executed, result in implementing fair scalable reader writer mutual exclusion for access to a critical section of a memory coupled to a processor by a plurality of processing threads executing on the processor by
-
15. A computer system for controlling access to a critical section of memory coupled to a processor in a multithreaded processing system comprising:
-
a plurality of processing threads executing on the processor, each thread having a stack; and a single word reader writer mutex pointing to a queue representing a list of threads desiring access to the critical section; wherein a first thread of the plurality of threads creates a first queue node 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;
adds the first queue node to the queue by setting pointers within the queue to point to the first queue node, 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;
waits 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;
enters the critical section when the condition is met;
exits the critical section;
removes the first queue node from the queue; and
prevents 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 Dependent Claims (16, 17, 18, 19, 20, 21)
-
Specification