# US 2023/0056500 A1 · Chained resource locking

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

- Number: US 2023/0056500 A1
- Document ID: US20230056500A1
- Status: Published application
- Kind: A1
- Application number: 17/405,457
- Filed: 2021-08-18
- Published: 2023-02-23
- Earliest claimed: 2021-08-18
- Assignees: Micron Technology, Inc.
- Applicants: Micron Technology, Inc.
- Inventors: Patrick Estep; Tony M. Brewer
- Web page: https://patentgrep.com/patent/US20230056500A1

## CPC

- G06F 9/526: {Mutual exclusion algorithms}
- G06F 9/5005: {to service a request}
- G06F 9/542: {Event management; Broadcasting; Multicasting; Notifications}
- G06F 2209/521: Atomic
- G06F 2209/548: Queue
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Devices and techniques for CHAINED RESOURCE LOCKING are described herein. Threads form a last-in-first-out (LIFO) queue on a resource lock to create a chained lock on the resource. A data store representing the lock for the resource holds the previous thread’s identifier, enabling a subsequent thread to wake the previous thread using the identifier when the subsequent thread releases the lock. Generally, the thread releasing the lock need not interact with the data store, reducing contention for the data store among many threads.

## Claims

### Claim 1

A system comprising:
a memory controller configured to maintain a datastore representing a lock of a resource; and
a hybrid threading processor (HTP) configured to execute a first thread to:
obtain a value from the datastore;
pause based on the value corresponding to a thread identifier indicating that the resource is locked, the thread identifier corresponding to a second thread;
execute using the resource based on a first wake message corresponding to the resource; and
release the lock by sending a second wake message to the second thread based on the thread identifier to awake the second thread to use the resource.

### Claim 2 (depends on 1)

The system of claim 1, wherein the HTP is configured to execute the thread to replace the value in the datastore with a second thread identifier of the first thread prior to pausing the first thread.

### Claim 3 (depends on 1)

The system of claim 1, wherein contents of the datastore correspond to one of unlocked, locked, or a thread identifier, wherein contents that correspond to locked and the thread identifier indicate that the resource is locked.

### Claim 4 (depends on 3)

The system of claim 3, wherein the datastore is a sixty-four bits.

### Claim 5 (depends on 4)

The system of claim 4, wherein contents of the datastore equivalent to a logical zero correspond to unlocked, the contents of the datastore equivalent to a logical one correspond to locked, and all other contents of the datastore correspond to thread identifiers.

### Claim 6 (depends on 3)

The system of claim 3, wherein the HTP is configured to execute a third thread to:
obtain a second value from the datastore;
determine that the second value is unlocked or locked;
perform an action based on the second value; and
release the lock.

### Claim 7 (depends on 6)

The system of claim 6, wherein the second value is unlocked, and wherein the action includes the HTP configured to execute the third thread to:
set the lock by changing contents of the datastore to locked; and
continue execution including using the resource based on the second value being unlocked.

### Claim 8 (depends on 6)

The system of claim 6, wherein the second value is locked, and wherein the action includes the HTP configured to execute the third thread to:
pause based on the second value indicating that the resource is locked;
awaken upon receipt of a third wake message corresponding to the resource; and
continue execution including using the resource based on the third wake message.

### Claim 9 (depends on 6)

The system of claim 6, wherein, to release the lock, the HTP is configured to execute the third thread to obtain a current value of the datastore.

### Claim 10 (depends on 9)

The system of claim 9, wherein the HTP configured to execute the third thread to:
determine that the current value is locked; and
change contents of the datastore to unlocked.

### Claim 11 (depends on 9)

The system of claim 9, wherein the HTP configured to execute the third thread to:
determine that the current value is a second thread identifier; and
send a third wake message that includes the second thread identifier to awake another thread to use the resource.

### Claim 12 (depends on 11)

The system of claim 11, the HTP configured to execute the third thread to change contents of the datastore to locked.

### Claim 13 (depends on 6)

The system of claim 6, wherein, to release the lock, the HTP configured to execute the third thread to perform an atomic operation at the memory controller to release the lock on the memory controller to change contents of the datastore.

### Claim 14 (depends on 13)

The system of claim 13, wherein the value is obtained in a return value of an atomic operation to acquire the lock on the memory controller, and wherein the atomic operation sets the lock by changing the contents of the datastore to locked.

### Claim 15

An apparatus comprising:
a network interface; and processing circuitry, in a hybrid thread processor (HTP), configured to execute a first thread to:
obtain, using the network interface, a value from a datastore representing a lock of a resource;
pause based on the value corresponding to a thread identifier indicating that the resource is locked, the thread identifier corresponding to a second thread;
execute using the resource based on a first wake message corresponding to the resource; and
release the lock by sending a second wake message, through the network interface, to the second thread based on the thread identifier to awake the second thread to use the resource.

### Claim 16 (depends on 15)

The apparatus of claim 15, wherein contents of the datastore correspond to one of unlocked, locked, or a thread identifier, wherein contents that correspond to locked and the thread identifier indicate that the resource is locked.

### Claim 17 (depends on 16)

The apparatus of claim 16, wherein the processing circuitry is configured to execute a third thread to:
obtain a second value from the datastore;
determine that the second value is unlocked or locked;
perform an action based on the second value; and
release the lock.

### Claim 18 (depends on 17)

The apparatus of claim 17, wherein the second value is unlocked, and wherein the action includes the HTP configured to execute the third thread to:
set the lock by changing contents of the datastore to locked; and
continue execution including using the resource based on the second value being unlocked.

### Claim 19 (depends on 17)

The apparatus of claim 17, wherein the second value is locked, and wherein the action includes the HTP configured to execute the third thread to:
pause based on the second value indicating that the resource is locked;
awaken upon receipt of a third wake message corresponding to the resource; and
continue execution including using the resource based on the third wake message.

### Claim 20 (depends on 17)

The apparatus of claim 17, wherein, to release the lock, the processing circuitry is configured to execute the third thread to obtain a current value of the datastore.

### Claim 21 (depends on 20)

The apparatus of claim 20, wherein the processing circuitry configured to execute the third thread to:
determine that the current value is locked; and
change contents of the datastore to unlocked.

### Claim 22 (depends on 20)

The apparatus of claim 20, wherein the processing circuitry configured to execute the third thread to:
determine that the current value is a second thread identifier; and
send a third wake message that includes the second thread identifier to awake another thread to use the resource.

### Claim 23 (depends on 22)

The apparatus of claim 22, the processing circuitry configured to execute the third thread to change contents of the datastore to locked.

### Claim 24 (depends on 17)

The apparatus of claim 17, wherein, to release the lock, the processing circuitry configured to execute the third thread to perform an atomic operation at a memory controller managing the datastore to release the lock by changing contents of the datastore.

### Claim 25 (depends on 24)

The apparatus of claim 24, wherein the value is obtained in a return value of an atomic operation to acquire the lock on the memory controller, and wherein the atomic operation sets the lock by changing the contents of the datastore to locked.

### Claim 26

Machine readable media including instructions that, when executed by processing circuitry, cause the processing circuitry to perform operations comprising:
obtaining, by a first thread executing in processing circuitry, a value from a datastore representing a lock of a resource;
pausing the first thread based on the value corresponding to a thread identifier indicating that the resource is locked, the thread identifier corresponding to a second thread;
executing the first thread using the resource based on a first wake message corresponding to the resource; and
releasing the lock by sending a second wake message, from the first thread, to the second thread based on the thread identifier to awake the second thread to use the resource.

### Claim 27 (depends on 26)

The machine readable media of claim 26, wherein contents of the datastore correspond to one of unlocked, locked, or a thread identifier, wherein contents that correspond to locked and the thread identifier indicate that the resource is locked.

### Claim 28 (depends on 27)

The machine readable media of claim 27, wherein the operations further comprise:
obtaining a second value from the datastore by a third thread;
determining that the second value is unlocked or locked;
performing an action based on the second value; and
releasing the lock.

### Claim 29 (depends on 28)

The machine readable media of claim 28, wherein the second value is unlocked, and wherein the action includes:
setting the lock by changing contents of the datastore to locked; and
continuing execution of the third thread including using the resource based on the second value being unlocked.

### Claim 30 (depends on 28)

The machine readable media of claim 28, wherein releasing the lock includes performing an atomic operation to release the lock on a memory controller to change contents of the datastore, wherein the datastore is memory, and wherein the memory controller manages the memory of the datastore.
