×

Reentrant read-write lock algorithm

  • US 9,658,900 B2
  • Filed: 10/12/2016
  • Issued: 05/23/2017
  • Est. Priority Date: 07/28/2015
  • Status: Active Grant
First Claim
Patent Images

1. A computer system for managing access to a shareable resource between a plurality of concurrently executing threads, access to the shareable resource being controlled by a lock, the lock being adapted to be acquired by one or more of the plurality of concurrently executing threads in at least a shared mode, an optimistic mode, and an exclusive mode, and the lock maintaining a list of threads requesting ownership of the lock, the computer system comprising:

  • one or more computer processors, one or more computer-readable storage media, and program instructions stored on one or more of the computer-readable storage media for execution by at least one of the one or more processors, to cause the one or more processors to perform a method comprising;

    providing a shared optimistic mode for the lock, the lock being acquirable in the shared optimistic mode by one or more of the plurality of concurrently executing threads;

    providing, for each change of mode requested by any thread of the plurality of concurrently executing threads, a lock state descriptor comprising an indication of a current mode, if any, in which the requesting thread has already acquired the lock;

    responsive to one or more of the plurality of concurrently executing threads acquiring the lock in the shared optimistic mode, allowing others of the plurality of concurrently executing threads to acquire the lock in the shared mode or the optimistic mode; and

    responsive to one or more of the plurality of concurrently executing threads which has acquired the lock in the shared optimistic mode requesting to acquire the lock in the exclusive mode, preventing others of the plurality of concurrently executing threads which have acquired the lock in the shared mode or the optimistic mode from acquiring the lock in the exclusive mode until one or more of the plurality of concurrently executing threads which has acquired the lock in the shared optimistic mode requesting to acquire the lock in the exclusive mode releases the lock.

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