×

Adaptive lock for a computing system having multiple runtime environments and multiple processing units

  • US 9,424,103 B2
  • Filed: 09/30/2014
  • Issued: 08/23/2016
  • Est. Priority Date: 09/30/2014
  • Status: Active Grant
First Claim
Patent Images

1. A method for operating a lock in a computing system having plural processing units, the lock being acquirable and releasable by plural threads generated in the computing system where each of the threads is either suspendable or non-suspendable, the method comprising:

  • in response to a lock-acquiring attempt made by a requester thread among the plural threads when the lock is held by a holder thread among the plural threads, determining, by a first processing unit that is assigned to execute the requester thread, whether the holder thread is suspendable or non-suspendable;

    when the first processing unit determines that the holder thread is non-suspendable, configuring, by the first processing unit, the requester thread to be in a spin state regardless of whether the requester thread is suspendable or non-suspendable, wherein the spin state is characterized by the requester thread continually making the lock-acquiring attempt and the first processing unit checking whether the attempt is successful;

    when the first processing unit determines that the holder thread is suspendable, determining, by the first processing unit, whether the requester thread is suspendable or non-suspendable unless the requester thread quits acquiring the lock;

    when the first processing unit determines that the requester thread is non-suspendable after the holder thread is determined to be suspendable, arranging, by the first processing unit, the requester thread to make the lock-acquiring attempt again; and

    when the first processing unit determines that the requester thread is suspendable after the holder thread is determined to be suspendable, adding, by the first processing unit, the requester thread to a wait queue as an additional suspended thread, wherein the wait queue is configured to store plural suspended threads that are allowable to be resumed by one of the plural processing units.

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