×

Transactional locking with read-write locks in transactional memory systems

  • US 8,973,004 B2
  • Filed: 06/26/2009
  • Issued: 03/03/2015
  • Est. Priority Date: 06/26/2009
  • Status: Active Grant
First Claim
Patent Images

1. A computer-implemented method, comprising:

  • associating each of a plurality of shared memory areas with a respective read-write lock, wherein for each shared memory area the read-write lock includes a read-lock portion indicating whether any thread has a read-lock for read-only access to the associated shared memory area and a write-lock portion indicating whether any thread has a write-lock for write access to the associated shared memory area, wherein for each respective read-write lock, the read-lock portion comprises a plurality of slots, wherein for each slot;

    a value of the slot is modifiable only by a respective thread and the value indicates whether the respective thread holds a read-lock for read-only access to the associated shared memory area;

    a thread executing a set of program instructions including a plurality of memory access operations to shared memory to be completed as an atomic transaction, wherein for each memory access operation of the atomic transaction said executing comprises;

    if the memory access is a read access;

    attempting to obtain the read-lock portion of the read-write lock for the corresponding shared memory area, wherein the read-lock portion is obtained only if no other thread holds the write-lock portion of the read-write lock; and

    performing the read access only after successfully obtaining the read-lock portion of the read-write lock; and

    if the memory access is a write access;

    attempting to obtain the write-lock portion of the read-write lock for the corresponding shared memory area, wherein the write-lock portion is obtained only if no other thread holds the write-lock portion of the read-write lock, wherein the write-lock portion is obtained if no other thread holds the write-lock portion while one or more other threads hold the read-lock portion of the read-write lock; and

    performing the write access only after successfully obtaining the write-lock portion of the read-write lock and no other thread holds the read-lock portion of the read-write lock.

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