×

Reentrant read-write lock algorithm

  • US 9,672,077 B2
  • Filed: 05/05/2016
  • Issued: 06/06/2017
  • Est. Priority Date: 07/28/2015
  • Status: Active Grant
First Claim
Patent Images

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

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

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

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

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

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