×

Concurrency control using slotted read-write locks

  • US 8,539,168 B2
  • Filed: 06/26/2009
  • Issued: 09/17/2013
  • Est. Priority Date: 06/26/2009
  • Status: Active Grant
First Claim
Patent Images

1. A non-transitory computer-readable storage medium storing program instructions executable by one or more processors to implement:

  • assigning each one of a plurality of threads to a respective one of a plurality of slots of a data structure, wherein the data structure comprises a pre-determined number of slots, each of which is individually addressable by the plurality of threads using a respective slot index, wherein each one of the plurality of threads is assigned to a different slot in the data structure such that at most only a single thread is assigned to any given one of the slots, wherein each of the respective slots in the data structure indicates whether the thread assigned to the slot has a read lock for a shared memory area, wherein the data structure further indicates whether any thread has a write lock for the shared memory area, and wherein multiple threads can concurrently have the read lock but only one thread can have the write lock at any given time; and

    one of the plurality of threads attempting to acquire the read lock for the shared memory area, wherein said attempting to acquire the read lock comprises;

    performing a store operation to set a field associated with the read lock in the thread'"'"'s assigned slot in the data structure to a value indicating acquisition of the read lock; and

    performing a load operation from the data structure to determine whether any thread has the write lock for the shared memory area, wherein the thread acquires the read lock for the shared memory area if no other thread has the write lock for the shared memory area.

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