Chained resource locking
AssigneeMicron Technology, Inc.
InventorsPatrick Estep, Tony M. Brewer
Life of this patent
Estimating the term…
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.
Claims20
A processor comprising:
- a register;
- and
- processing circuitry that, when in operation, is configured to:
- read, by a first thread executing on the processor, a thread ID for a second thread stored in the register corresponding to a resource;
- overwrite, by the first thread, the thread ID for the second thread with a thread ID for the first thread;
- sleep, by the first thread;
- wake, by the first thread, based on a wake message sent by a third thread upon release of the resource, the third thread having read the thread ID for the first thread from the register after the first thread was sleeping;
- and
- execute, by the first thread, a task that uses the resource based on waking from the wake message sent by the third thread.
A non-transitory machine readable media including instructions that, when executed by processing circuitry of a processor, cause the processing circuitry to perform operations comprising:
- reading, by a first thread, a thread ID for a second thread stored in a register corresponding to a resource;
- overwriting, by the first thread, the thread ID for the second thread with a thread ID for the first thread;
- sleeping, by the first thread;
- waking, by the first thread, based on a wake message sent by a third thread upon release of the resource, the third thread having read the thread ID for the first thread from the register after the first thread was sleeping;
- and
- executing, by the first thread, a task that uses the resource based on waking from the wake message sent by the third thread.
Dependencies are inferred from the claim text.