×

Lock mechanism to reduce waiting of threads to access a shared resource by selectively granting access to a thread before an enqueued highest priority thread

  • US 8,607,239 B2
  • Filed: 12/31/2009
  • Issued: 12/10/2013
  • Est. Priority Date: 12/31/2009
  • Status: Expired due to Fees
First Claim
Patent Images

1. In association with a plurality of processors including two or more processors that each provides one of a set of specified threads to access a shared resource, wherein the shared resource can only be accessed by one thread at a given time, a locking mechanism enables a first one of the set of specified threads to access the shared resource while each of the other specified threads is retained in a waiting queue, and a second one of the specified threads occupies a position of highest priority in the queue, a method comprising the steps of:

  • identifying a time period between a time when the first specified thread releases access to the shared resource, and a later time when the second specified thread becomes enabled to access the shared resource;

    responsive to an additional thread that is not one of the specified threads being provided by a processor to access the shared resource during the identified time period, determining whether a first prespecified criterion pertaining to the specified threads retained in said queue has been met, said first prespecified criterion is that the number of threads retained in said queue during said identified time period is greater than a number which is determined from a specified relationship of the number of threads in the queue to the number of processors in said configuration of processors;

    responsive to said first criterion being met, determining whether a second prespecified criterion has been met, wherein said second criterion is that the number of specified threads in said queue has not decreased since a specified prior time; and

    responsive to said second criterion being met before said second specified thread acquires said lock, enabling said additional thread to access the shared resource before the second specified thread accesses the shared resource.

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