# US 2022/0044701 A1 · Reader Bias Based Locking Technique Enabling High Read Concurrency For Read-Mostly Workloads

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2022/0044701 A1
- Document ID: US20220044701A1
- Status: Published application
- Kind: A1
- Application number: 17/507,714
- Filed: 2021-10-21
- Published: 2022-02-10
- Earliest claimed: 2018-09-20
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: David Dice; Alex Kogan
- Web page: https://patentgrep.com/patent/US20220044701A1

## CPC

- G11B 20/10268: {bit detection or demodulation methods}
- G06F 9/526: {Mutual exclusion algorithms}
- G06F 16/2343: {Locking methods, e.g. distributed locking or locking implementation details}
- G06F 16/2365: {Ensuring data consistency and integrity}
- G11B 20/105: {selecting parameter values from a plurality of predetermined settings}
- G11C 16/22: Safety or protection circuits preventing unauthorised or accidental access to memory cells
- G11C 16/26: Sensing or reading circuits; Data output circuits
- G11B: INFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER (recording measured values in a way that does not require playback through a transducer G01D9/00; recording or playback apparatus using mechanically marked tape, e.g. punched paper tape, or using unit records, e.g. punched or magnetically marked cards G06K; transferring data from one type of record carrier to another G06K1/18; circuits for coupling output of reproducer to radio receiver H04B1/20; gramophone pick-ups or like acoustic electromechanical transducers or circuits therefor H04R)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G11C: STATIC STORES (semiconductor memory devices H10B)

## 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

### Claim at position 1

-20. (canceled)

### Claim 21

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.

### Claim 22 (depends on 21)

The computer-implemented method as recited in claim 21, 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.

### Claim 23 (depends on 21)

The computer-implemented method as recited in claim 21, 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.

### Claim 24 (depends on 23)

The computer-implemented method as recited in claim 23, 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.

### Claim 25 (depends on 21)

The computer-implemented method as recited in claim 21, 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.

### Claim 26 (depends on 25)

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

### Claim 27 (depends on 25)

The computer-implemented method as recited in claim 25, 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.

### Claim 28

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.

### Claim 29 (depends on 28)

The system as recited in claim 28, 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.

### Claim 30 (depends on 28)

The system as recited in claim 28, 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.

### Claim 31 (depends on 30)

The system as recited in claim 30, 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.

### Claim 32 (depends on 28)

The system as recited in claim 28, 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.

### Claim 33 (depends on 32)

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

### Claim 34 (depends on 32)

The system as recited in claim 32, 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.

### Claim 35

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.

### Claim 36 (depends on 35)

The one or more non-transitory computer-accessible storage media as recited in claim 35, 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.

### Claim 37 (depends on 35)

The one or more non-transitory computer-accessible storage media as recited in claim 35, 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.

### Claim 38 (depends on 37)

The one or more non-transitory computer-accessible storage media as recited in claim 37, 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.

### Claim 39 (depends on 35)

The one or more non-transitory computer-accessible storage media as recited in claim 35, 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.

### Claim 40 (depends on 39)

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