IP Library › Granted Patent US 11,170,816
Granted Patent B2
US 11,170,816 · App. 17/020,655 · Granted Nov 9, 2021

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

Inventors: David Dice (Burlington, MA); Alex Kogan (Burlington, 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,170,816
App. No.
17/020,655
Granted
Nov 9, 2021
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 (55)

1. A method, comprising:

performing, at one or more computing devices:

detecting, by a first reader of a plurality of data accessors, a first setting of a condition indicator, wherein the condition indicator is associated with at least a first data object, and wherein a first lock is associated with the first data object;

storing, by the first reader after said detecting, and without acquiring the first lock, an indication in a readers structure that the first reader has obtained read access to the first data object; and

verifying, by a first writer of the plurality of data accessors, prior to implementing a write operation of the first data object, that at least a portion of the readers structure has been cleared.

2. The method as recited in claim 1 , further comprising performing, at the one or more computing devices:

in response to verifying, by the first reader after storing the indication in the readers structure, that the first setting of the condition indicator has not been replaced by a second setting, performing one or more reads of the first data object by the first reader without acquiring the first lock.

3. The method as recited in claim 1 , further comprising performing, at the one or more computing devices:

in response to detecting, by the first reader after storing the indication in the readers structure, that the first setting of the condition indicator has been replaced by a second setting, clearing the indication in the readers structure by the first reader without performing a read operation on the first data object.

4. The method as recited in claim 1 , further comprising performing, at the one or more computing devices:

replacing, by the first writer in response to detecting the first setting of the condition indicator, the first setting to a second setting prior to said verifying that at least the portion of the readers structure has been cleared; and

determining, by a second reader of the plurality of data accessors in response to the detecting the second setting, that the first lock is to be acquired by the second reader prior to performing a read operation on the first data object.

5. The method as recited in claim 1 , further comprising performing, by the one or more computing devices:

determining, by the first writer, one or more metrics associated with the readers structure; and

selecting, by the first writer, based at least in part on the one or more metrics, a time interval during which a particular setting of the condition indicator is to remain in effect.

6. The method as recited in claim 1 , further comprising performing, by the one or more computing devices:

initiating, by the first writer, a parallel read operation on the readers structure to verify that at least the portion of the readers structure has been cleared.

7. The method as recited in claim 1 , wherein storing the indication in the readers structure comprises performing a compare-and-swap operation.

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 reader of a plurality of data accessors to:

detect a first setting of a condition indicator, wherein the condition indicator is associated with at least a first data object, and wherein a first lock is associated with the first data object;

store, after detection of the first setting, without acquiring the first lock, an indication in a readers structure that the first reader has obtained read access to the first data object; and

cause a first writer of the plurality of data accessors to verify, prior to implementing a write operation of the first data object, that at least a portion of the readers structure has been cleared.

9. 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 reader to, in response to a verification that the first setting of the condition indicator has not changed after the indication in the readers structure is stored, perform one or more reads of the first data object without acquiring the first lock.

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 reader to, in response to a detection that the first setting of the condition indicator has been changed after the indication in the readers structure is stored, clear the indication in the readers structure without performing a read operation on the first data object.

11. 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, in response to detecting the first setting of the condition indicator, replace the first setting to a second setting prior to verifying that at least the portion of the readers structure has been cleared; and

cause a second reader of the plurality of data accessors to determine, in response to the detecting the second setting, that the first lock is to be acquired by the second reader prior to performing a read operation on the first data object.

12. 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:

obtain one or more metrics associated with the readers structure; and

determine, based at least in part on the one or more metrics, a time interval during which a particular setting of the condition indicator is to remain in effect.

13. 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 initiate a parallel read operation on the readers structure to verify that at least the portion of the readers structure has been cleared.

14. The system as recited in claim 8 , wherein to store the indication in the readers structure, 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 perform an atomic modification operation.

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 reader of a plurality of data accessors to:

detect a first setting of a condition indicator, wherein the condition indicator is associated with at least a first data object, and wherein a first lock is associated with the first data object; and

store, after detection of the first setting, without acquiring the first lock, an indication in a readers structure that the first reader has obtained read access to the first data object; and

cause a first writer of the plurality of data accessors to verify, prior to implementing a write operation of the first data object, that at least a portion of the readers structure has been cleared.

16. The one or more non-transitory computer-accessible storage media as recited in claim 15 , storing further program instructions that when executed on or across the one or more processors:

cause the first reader to, in response to a verification that the first setting of the condition indicator has not changed after the indication in the readers structure is stored, perform one or more reads of the first data object without acquiring the first lock.

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

cause the first reader to, in response to a detection that the first setting of the condition indicator has been changed after the indication in the readers structure is stored, clear the indication in the readers structure without performing a read operation on the first data object.

18. The one or more non-transitory computer-accessible storage media as recited in claim 15 , storing further program instructions that when executed on or across the one or more processors:

cause the first writer to, in response to detecting the first setting of the condition indicator, replace the first setting to a second setting prior to verifying that at least the portion of the readers structure has been cleared; and

cause a second reader of the plurality of data accessors to determine, in response to the detecting the second setting, that the first lock is to be acquired by the second reader prior to performing a read operation on the first data object.

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

obtain one or more metrics associated with the readers structure; and

determine, based at least in part on the one or more metrics, a time interval during which a particular setting of the condition indicator is to remain in effect.

20. The one or more non-transitory computer-accessible storage media as recited in claim 15 , storing further program instructions that when executed on or across the one or more processors:

cause the first writer to initiate a parallel read operation on the readers structure to verify that at least the portion of the readers structure has been cleared.

Continuity (4)
Continuation 16739851 · Jan 10, 2020
Continuation 16290431 · Mar 1, 2019
Provisional Application 62734197 · Sep 20, 2018
Related Publication 20200411049A1 · Dec 31, 2020
Cited By (3)
US 12,254,900 US 12,322,414 US 12,340,260