×

Almost fair busy lock

  • US 9,697,055 B2
  • Filed: 09/22/2015
  • Issued: 07/04/2017
  • Est. Priority Date: 11/18/2014
  • Status: Active Grant
First Claim
Patent Images

1. A method for managing exclusive control of a shareable resource, the method comprising:

  • publishing a current state of a lock and a claim non atomically to the lock by a next owning thread 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 by the next owning thread whether the next owning thread has been pre-empted;

    determining by a subsequent owning thread whether the next owning thread has been preempted by comparing the current state of the lock with the claim,wherein the subsequent owning thread is scheduled to follow the next owning thread;

    responsive to determining whether the next owning thread has been preempted, acquiring by the next owning thread the lock if the next owning thread has not been pre-empted;

    responsive to determining whether the next owning thread has been preempted, retrying by the next owning thread acquisition of the lock if the next owning thread has been pre-empted; and

    responsive to determining that the next owning thread has been pre-empted, acquiring by the subsequent owning thread 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.

View all claims
  • 1 Assignment
Timeline View
Assignment View
    ×
    ×