×

System and Method for Implementing Hierarchical Queue-Based Locks Using Flat Combining

  • US 20120311606A1
  • Filed: 06/02/2011
  • Published: 12/06/2012
  • Est. Priority Date: 06/02/2011
  • Status: Active Grant
First Claim
Patent Images

1. A method, comprising:

  • performing by a computer;

    beginning execution of a multithreaded application that comprises one or more requests to acquire a shared lock;

    a thread of the application executing on one of a plurality of processor cores in a cluster of processor cores that share a memory posting a request to acquire the shared lock in a publication list for the cluster using a non-atomic operation write operation, wherein the publication list comprises a plurality of nodes, each of which is associated with a respective thread that accesses the shared lock, and wherein the cluster of processor cores is one of a plurality of clusters of processor cores;

    the thread building a local lock acquisition request queue comprising the node associated with the thread and one or more other nodes of the publication list for the cluster, wherein each of the one or more other nodes is associated with a respective thread that has posted a request to acquire the shared lock, and wherein the local lock acquisition request queue is an ordered queue in which each node of the queue comprises a pointer to its successor node in the queue;

    the thread splicing the local lock acquisition queue into a global lock acquisition request queue for the shared lock as a sub-queue of the global lock acquisition request queue, wherein the global lock acquisition request queue comprises one or more other sub-queues, each of which comprises one or more nodes associated with threads executing on a processor core in a particular cluster of processor cores;

    the thread waiting for an indication that it has been granted the shared lock; and

    in response to the thread receiving an indication that it has been granted the shared lock, the thread accessing a critical section or shared resource that is protected by the shared lock.

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