×

Reader-writer lock

  • US 9,934,077 B2
  • Filed: 02/11/2016
  • Issued: 04/03/2018
  • Est. Priority Date: 01/22/2014
  • Status: Active Grant
First Claim
Patent Images

1. A computer-implemented method for processing a set of access requests of a resource shared by a set of threads, the method comprising:

  • creating a set of pools for storing the set of access requests of the resource, the set of pools including a first pool configured to be active and a second pool configured to be inactive;

    processing a first request of a first type of the set of access requests of the first pool, wherein processing a first request of a first type further comprises;

    counting with a first counter, using an atomic process to increment the first counter in response to a first bit of the first counter being enabled, a number of read locks held in the first pool, wherein the first bit is initially set to be enabled;

    counting with a second counter, using the atomic process to increment the second counter in response to a second bit of the second counter being enabled, a number of outstanding read lock requests in the first pool, wherein the second bit is initially set to be disabled; and

    indicating with a flag either the first counter or the second counter but not both, configured to discern the first counter from the second counter, wherein the flag is initially set to identify the first counter; and

    switching, in response to processing a second request of a second type of the set of access requests of the first pool, the first pool to be the second pool configured to be inactive and the second pool to be the first pool configured to be active.

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