IP Library › Granted Patent US 11,594,252
Granted Patent B2
US 11,594,252 · App. 17/507,714 · Granted Feb 28, 2023

Reader bias based locking technique enabling high read concurrency for read-mostly workloads

Inventors: David Dice (Foxboro, MA); Alex Kogan (Needham, MA)
Assignee: Oracle International Corporation
G11B20/10268G06F9/526G06F16/2343G06F16/2365G11B20/105G11C16/26
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,594,252
App. No.
17/507,714
Granted
Feb 28, 2023
Kind
B2
Abstract

A data object has a lock and a condition indicator associated with it. Based at least partly on detecting a first setting of the condition indicator, a reader stores an indication that the reader has obtained read access to the data object in an element of a readers structure and reads the data object without acquiring the lock. A writer detects the first setting and replaces it with a second setting, indicating that the lock is to be acquired by readers before reading the data object. Prior to performing a write on the data object, the writer verifies that one or more elements of the readers structure have been cleared.

Claims (48)

1. A computer-implemented method, comprising:

examining, by a first writer after acquiring a lock on a first data object and prior to initiating a write operation on the first data object, a readers structure associated with one or more data objects including the first data object;

determining, by the first writer based at least in part on said examining, that the write operation directed to the first data object is to be deferred until the readers structure is updated to indicate completion of a read operation; and

initiating the write operation by the first writer after the readers structure is updated to indicate completion of the read operation.

2. The computer-implemented method as recited in claim 1 , further comprising:

changing, by the first writer prior to examining the readers structure, a condition indicator associated with the first data object to a particular value; and

determining, by a first reader of the first data object, based at least in part on the particular value, that the first reader has to acquire the lock prior to initiating a read operation on the first data object.

3. The computer-implemented method as recited in claim 1 , further comprising:

storing, by the first writer after the readers structure is updated, an indication of a time period for which a condition indicator associated with the first data object is to remain unchanged, wherein the condition indicator is used by readers of the first data object to determine whether read operations directed to the first data object can be initiated without acquiring the lock.

4. The computer-implemented method as recited in claim 3 , further comprising:

determining the time period by the first writer based at least in part on a duration for which the write operation is deferred.

5. The computer-implemented method as recited in claim 1 , further comprising:

storing, prior to the examining by the first writer, an entry in the readers structure by a first reader, wherein the entry indicates that the read operation is going to be initiated by the first reader, and wherein the examining comprises reading the entry by the first writer.

6. The computer-implemented method as recited in claim 5 , wherein storing the entry comprises utilizing a compare-and-swap operation.

7. The computer-implemented method as recited in claim 5 , further comprising:

identifying, by the first reader, using a deterministic mapping function, a location at which the entry is to be stored within the readers structure.

8. A system, comprising:

one or more computing devices;

wherein the one or more computing devices include instructions that upon execution on or across one or more processors cause a first writer of a set of data accessors to:

examine, after acquiring a lock on a first data object and prior to initiating a write operation on the first data object, a readers structure associated with one or more data objects including the first data object;

determine, based at least in part on examination of the readers structure, that the write operation directed to the first data object is to be deferred until the readers structure is updated to indicate completion of a read operation; and

initiate the write operation after the readers structure is updated to indicate completion of the read operation.

9. The system as recited in claim 8 , wherein the set of data accessors includes a first reader, and wherein the one or more computing devices include further instructions that upon execution on or across the one or more processors:

cause the first writer to change, prior to examining the readers structure, a condition indicator associated with the first data object to a particular value; and

cause the first reader to determine, based at least in part on the particular value, that the first reader has to acquire the lock prior to initiating a read operation on the first data object.

10. The system as recited in claim 8 , wherein the one or more computing devices include further instructions that upon execution on or across the one or more processors cause the first writer to:

store, after the readers structure is updated, an indication of a time period for which a condition indicator associated with the first data object is to remain unchanged, wherein the condition indicator is used by readers of the first data object to determine whether read operations directed to the first data object can be initiated without acquiring the lock.

11. The system as recited in claim 10 , wherein the one or more computing devices include further instructions that upon execution on or across the one or more processors cause the first writer to:

determine the time period based at least in part on a duration for which the write operation is deferred.

12. The system as recited in claim 8 , wherein the set of data accessors includes a first reader, and wherein the one or more computing devices include further instructions that upon execution on or across the one or more processors:

cause the first reader to store an entry in the readers structure, wherein the entry indicates that the read operation is going to be initiated by the first reader, and wherein examination of the readers structure by the first writer comprises reading the entry by the first writer.

13. The system as recited in claim 12 , wherein to store the entry, the first reader utilizes a compare-and-swap operation.

14. The system as recited m claim 12 , wherein the one or more computing devices include further instructions that upon execution on or across the one or more processors:

cause the first reader to identify a location at which the entry is to be stored within the readers structure, wherein the location is identified using one or more of: (a) a time-based mapping function or (b) a random-number based mapping function.

15. One or more non-transitory computer-accessible storage media storing program instructions that when executed on or across one or more processors cause a first writer of a set of data accessors to:

examine, after acquiring a lock on a first data object and prior to initiating a write operation on the first data object, a readers structure associated with one or more data objects including the first data object;

determine, based at least in part on examination of the readers structure, that the write operation directed to the first data object is to be deferred until the readers structure is updated to indicate completion of a read operation; and

initiate the write operation after the readers structure is updated to indicate completion of the read operation.

16. The one or more non-transitory computer-accessible storage media as recited in claim 15 , wherein the set of data accessors includes a first reader, and wherein the one or more non-transitory computer-accessible storage media store further program instructions that when executed on or across the one or more processors:

cause the first writer to change, prior to examining the readers structure, a condition indicator associated with the first data object to a particular value; and

cause the first reader to determine, based at least in part on the particular value, that the first reader has to acquire the lock prior to initiating a read operation on the first data object.

17. The one or more non-transitory computer-accessible storage media as recited in claim 15 , wherein the one or more non-transitory computer-accessible storage media store further program instructions that when executed on or across the one or more processors cause the first writer to:

store, after the readers structure is updated, an indication of a time period for which a condition indicator associated with the first data object is to remain unchanged, wherein the condition indicator is used by readers of the first data object to determine whether read operations directed to the first data object can be initiated without acquiring the lock.

18. The one or more non-transitory computer-accessible storage media as recited in claim 17 , wherein the one or more non-transitory computer-accessible storage media store further program instructions that when executed on or across the one or more processors cause the first writer to:

determine the time period based at least in part on a duration for which the write operation is deferred.

19. The one or more non-transitory computer-accessible storage media as recited in claim 15 , wherein the set of data accessors includes a first reader, and wherein the one or more non-transitory computer-accessible storage media store further program instructions that when executed on or across the one or more processors:

cause the first reader to store an entry in the readers structure, wherein the entry indicates that the read operation is going to be initiated by the first reader, and wherein the examination of the readers structure by the first writer comprises reading the entry by the first writer.

20. The one or more non-transitory computer-accessible storage media as recited in claim 19 , wherein to store the entry, the first reader utilizes an atomic modification operation.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 22, 2021
From: DICE, DAVID; KOGAN, ALEX
To: ORACLE INTERNATIONAL CORPORATION
Reel/Frame 057878/0974 →
Continuity (5)
Continuation 17020655 · Sep 14, 2020
Continuation 16739851 · Jan 10, 2020
Continuation 16290431 · Mar 1, 2019
Provisional Application 62734197 · Sep 20, 2018
Related Publication 20220044701A1 · Feb 10, 2022
Cited By (2)
US 12,254,900 US 12,322,414