Reader bias based locking technique enabling high read concurrency for read-mostly workloads
AssigneeOracle International Corporation
InventorsDavid Dice, Alex Kogan
Life of this patent
Estimating the term…
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.
Claims20
A method, comprising:
- performing, at one or more computing devices:
- based at least in part on detecting a first setting of a condition indicator by a first reader of a plurality of data accessors, wherein the plurality of data accessors includes one or more readers and one or more writers, 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 in a particular element of a plurality of elements of a readers structure, an indication that the first reader has obtained read access to the first data object;
- and
- clearing, by the first reader, the particular element after the first reader completes one or more read operations without acquiring the first lock;
- and
- based at least in part on detecting, by a first writer of the one or more writers, the first setting of the condition indicator,
- replacing, by the first writer, the first setting with a second setting, wherein the second setting indicates that the first lock is to be obtained by a reader attempting to read the first data object;
- and
- verifying, by the first writer prior to implementing a write operation on the first data object, that one or more elements in the readers structure have been cleared.
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 which includes one or more readers and one or more writers to:
- based at least in part on detecting 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, in a particular element of a plurality of elements of a readers structure, an indication that the first reader has obtained read access to the first data object;
- and
- clear, by the first reader, the particular element after the first reader completes one or more read operations without acquiring the first lock;
- and
- cause a first writer of the one or more writers to:
- based at least in part on detecting the first setting of the condition indicator,
- replace the first setting with a second setting, wherein the second setting indicates that the first lock is to be obtained by a reader attempting to read the first data object;
- and
- verify, prior to implementing a write operation on the first data object, that one or more elements in the readers structure have been cleared.
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 which includes one or more readers and one or more writers to:
- based at least in part on detecting a first setting of a condition indicator, wherein the condition indicator is associated with a first data object, and wherein a first lock is associated with the first data object,
- store, in a particular element of a plurality of elements of a readers structure, an indication that the first reader has obtained read access to the first data object;
- and
- clear, by the first reader, the particular element after the first reader completes one or more read operations without acquiring the first lock;
- and
- cause a first writer of the one or more writers to:
- based at least in part on detecting the first setting of the condition indicator, replace the first setting with a second setting, wherein the second setting indicates that the first lock is to be obtained by a reader attempting to read the first data object;
- and
- verify, prior to implementing a write operation on the first data object, that one or more elements in the readers structure have been cleared.
Dependencies are inferred from the claim text.