×

System and method for implementing scalable adaptive reader-writer locks

  • US 9,996,402 B2
  • Filed: 04/07/2014
  • Issued: 06/12/2018
  • Est. Priority Date: 04/07/2014
  • 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 reader-writer lock, wherein the reader-writer lock controls write access to a critical section of code by concurrently executing threads of the application and further controls access to the critical section of code in read-only mode, wherein the reader-writer lock allows at most one writer thread to hold the reader-writer lock for writing at a time, and wherein the reader-writer lock allows multiple reader threads to hold the reader-writer lock in read-only mode at the same time;

    a given thread of the application requesting acquisition of the reader-writer lock;

    determining that another thread has acquired the reader-writer lock;

    determining one of a plurality of available actions to be taken in response to said requesting;

    taking the determined action; and

    the other thread releasing the reader-writer lock, wherein said releasing comprises waking one or more reader threads wishing to acquire the reader-writer lock that are in a sleep state and a single writer thread of a plurality of writer threads wishing to acquire the reader-writer lock that are in a sleep state.

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