×

Reentrant read-write lock algorithm

  • US 9,471,400 B1
  • Filed: 07/28/2015
  • Issued: 10/18/2016
  • Est. Priority Date: 07/28/2015
  • Status: Expired due to Fees
First Claim
Patent Images

1. A computer program product 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 acquired 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 computer program product comprising:

  • a computer readable storage medium having program instructions embodied therewith, the program instructions executable by a computer to cause the computer to;

    provide 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;

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

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

    responsive to one or more of said plurality of concurrently executing threads which has acquired said lock in said shared optimistic mode requesting to acquire said lock in said exclusive mode, prevent others of said plurality of 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 one or more of said plurality of concurrently executing threads which has acquired said lock in said shared optimistic mode requesting to acquire said lock in said exclusive mode releases the lock.

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