Read-write spinlock
AssigneeHewlett-Packard Development Company, L.P.
InventorsDouglas V. Larson, Marcia E. McConnell
Life of this patent
Estimating the term…
Loading patent…
AssigneeHewlett-Packard Development Company, L.P.
InventorsDouglas V. Larson, Marcia E. McConnell
Estimating the term…
An embodiment of the invention provides an apparatus and method for controlling access by a read-write spinlock with no mutual exclusion among readers. The apparatus and method perform the steps of using values in a data structure in the read-write spinlock to control read access to a shared object and using values in the data structure and a guard lock to control write access to the shared object.
A method comprising:
An apparatus comprising:
An apparatus for controlling access by a read-write spinlock with no mutual exclusion among readers, the apparatus comprising:
An article of manufacture comprising a non-transitory machine-readable storage medium having stored thereon instructions to:
A method comprising:
Dependencies are inferred from the claim text.
Drawings are temporarily unavailable. Open the PDF at USPTO
From the US filing history. Foreign family members aren’t listed.
Program synchronisation; Mutual exclusion, e.g. by means of semaphores: mutual exclusion algorithms
Indexing scheme relating to G06F9/52: mode
Computing and data processing
About 6 years 9 months of term left · ends 21 Jul 2033 (estimated)
Embodiments of the invention relate generally to a read-write spinlock with no mutual exclusion among readers.
In software engineering, a spinlock is a lock where a requester (e.g., a processor) waits in a loop (“spins”) and the requester repeatedly checks if it can obtain the lock while waiting in the loop. After the requester obtains the spinlock, the requester will hold the spinlock until the requester releases the spinlock. The requester is required to hold the spinlock in order to access to a shared object such as, for example, a critical section in a memory, a shared data structure, a semaphore, or other suitable shared resources.
One type of spinlock is the read-write spinlock. A read-write spinlock permits multiple readers (i.e., requesters performing reading) to access the shared object at the same time, but the read-write spinlock only permits one writer (i.e., a requester performing writing) to access the shared object at any particular time, and the readers are not permitted to read to the shared object when a writer is writing to the shared object.
Non-limiting and non-exhaustive embodiments of the present invention are described with reference to the following figures, wherein like reference numerals refer to like parts throughout the various views unless otherwise specified.
FIG. 1 is a block diagram of an apparatus (system) in accordance with an embodiment of the invention.
FIG. 2 is a flow diagram of a method in accordance with an embodiment of the invention.
In the description herein, numerous specific details are provided, such as examples of components and/or methods, to provide a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that an embodiment of the invention can be practiced without one or more of the specific details, or with other apparatus, systems, methods, components, materials, parts, and/or the like. In other instances, well-known structures, materials, or operations are not shown or described in detail to avoid obscuring aspects of embodiments of the invention.
FIG. 1 is a block diagram of an apparatus (system) 100 in accordance with an embodiment of the invention. A read-write spinlock 105 is used to control the access of readers and writers to a shared object 110 in a memory 115. The shared object 110 can be, for example, a critical section in a memory, a shared data structure, a semaphore, or other suitable shared resources. In the example of FIG. 1, two readers (reader 120 and reader 125) and two writers (writer 130 and writer 135) are shown. However, the number of readers and writers may vary. A reader is a processor (e.g., CPU) that is performing a read operation on the shared object 110 and a writer is a processor that is performing a write operation on the shared object 110. Therefore, since the blocks 120, 125, 130, and 135 are processors, the readers 120 and 125 can subsequently perform write operations as writers, and the writers 130 and 135 can subsequently perform read operations as readers.
In an embodiment of the invention, the read-write spinlock 105 includes a data structure 140 and a guard lock 145, as described further below. The data structure 140 can be a suitable size such as, for example, approximately 8 bytes or 4 bytes. If the data structure 140 is 8 bytes in size, then the data structure 140 may have the following example data layout, although variations in the below data layout may also be implemented: