×

System and method for implementing reader-writer locks using hardware transactional memory

  • US 9,342,380 B2
  • Filed: 03/05/2013
  • Issued: 05/17/2016
  • Est. Priority Date: 03/05/2013
  • Status: Active Grant
First Claim
Patent Images

1. A method, comprising:

  • performing, by a computer;

    beginning execution of a multithreaded application that comprises one or more requests to acquire a shared reader-writer lock, wherein the shared reader-writer lock comprises a tail pointer and an ordered list of zero or more nodes, wherein the shared reader-writer lock controls access to a critical section of code or a shared resource by concurrently executing threads of the application;

    a given thread of the application inserting a node in the ordered list of nodes, wherein each node in the ordered list of nodes is owned by a respective thread that holds the shared reader-writer lock or that desires access to the critical section of code or the shared resource in a read-only mode or in a write mode, and wherein only one thread can hold the shared reader-writer lock in a write mode at a time;

    subsequent to said inserting, the given thread acquiring the shared reader-writer lock in a read-only mode or in a write mode; and

    subsequent to said acquiring, the given thread releasing the shared reader-writer lock, wherein said releasing comprises removing the inserted node from the ordered list of nodes;

    wherein at least one of said inserting or said releasing comprises updating a value of the tail pointer within a hardware transaction that employs a hardware transactional memory (HTM), or modifying a field of at least one node in the ordered list of nodes within a hardware transaction that employs the HTM.

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