发明名称 |
ALMOST FAIR BUSY LOCK |
摘要 |
Managing exclusive control of a shareable resource includes publishing a claim non atomically to a lock by a thread that is next to own the lock in an ordered set of threads that have requested to own the lock. The claim includes a structure capable of being read and written only in a single memory access. A determination is made of whether the next owning thread has been pre-empted. Responsive to the determination, the next owning thread of the lock acquires the lock if the next owning thread has not been pre-empted and retries acquisition of the lock if the next owning thread has been pre-empted. Responsive to the next owning thread being pre-empted, a subsequent owning thread acquires the lock unfairly and atomically, consistently modifies the lock such that a next lock owner can determine that the next lock owner has been preempted. |
申请公布号 |
US2016139966(A1) |
申请公布日期 |
2016.05.19 |
申请号 |
US201514860965 |
申请日期 |
2015.09.22 |
申请人 |
International Business Machines Corporation |
发明人 |
Greco Marco |
分类号 |
G06F9/52 |
主分类号 |
G06F9/52 |
代理机构 |
|
代理人 |
|
主权项 |
1. A method for managing exclusive control of a shareable resource, the method comprising:
publishing a claim non atomically to a lock by a thread that is next to own the lock in an ordered set of threads that have requested to own the lock, the claim comprising a structure capable of being read and written only in a single memory access; determining whether the next owning thread has been pre-empted; responsive to the determination, the next owning thread of the lock acquiring the lock if the next owning thread has not been pre-empted and retrying acquisition of the lock if the next owning thread has been pre-empted; and responsive to the next owning thread being pre-empted, a subsequent owning thread acquiring the lock unfairly and atomically, consistently modifying the lock such that a next lock owner can determine that the next lock owner has been preempted. |
地址 |
Armonk NY US |