Fine-locked transactional memory
First Claim
1. A computer-implemented method, comprising:
- partitioning at least a portion of shared memory accessible concurrently by a plurality of threads, into a plurality of partitions and associating the plurality of partitions with respective locks;
a first of the plurality of threads attempting to execute as an atomic memory transaction a first set of operations, the first set of operations including accesses to one or more of the plurality of partitions, wherein the accesses are performed in a first transactional mode, said performing the accesses in the first transactional mode being dependent on reading but not on acquiring those of the plurality of locks associated with the one or more accessed partitions;
receiving an indication that the attempt to execute the first set of operations as an atomic memory transaction in the first transactional mode failed and in response, attempting to execute the first set of operations as an atomic memory transaction in a second transactional mode, said executing the operations in a second transactional mode comprising;
attempting to execute a second set of operations to acquire a subset of the plurality of locks associated with the partitions accessed by the first set of operations, wherein the second set of operations is executed as an atomic memory transaction in the first transactional mode;
performing the first set of operations; and
releasing the acquired locks.
2 Assignments
0 Petitions
Accused Products
Abstract
A method comprises associating a plurality of locks with a data object accessed concurrently by a plurality of threads, where each lock corresponds to a respective partition of the object. The method includes using a first non-blocking transaction (such as a Hardware Transactional-Memory (HTM) transaction) to attempt to complete a programmer-specified transaction. The first non-blocking transaction may access one or more of the locks but may not actually acquire any of the locks. In response to an indication that the first non-blocking transaction failed to complete, the method may include acquiring a set of locks in another non-blocking transaction, where the set of locks corresponds to a set of partitions expected to be accessed in the programmer-specified transaction. If the set of locks is acquired, the method may include performing the memory access operations of the programmer-specified transaction, and releasing the set of locks.
14 Citations
20 Claims
-
1. A computer-implemented method, comprising:
-
partitioning at least a portion of shared memory accessible concurrently by a plurality of threads, into a plurality of partitions and associating the plurality of partitions with respective locks; a first of the plurality of threads attempting to execute as an atomic memory transaction a first set of operations, the first set of operations including accesses to one or more of the plurality of partitions, wherein the accesses are performed in a first transactional mode, said performing the accesses in the first transactional mode being dependent on reading but not on acquiring those of the plurality of locks associated with the one or more accessed partitions; receiving an indication that the attempt to execute the first set of operations as an atomic memory transaction in the first transactional mode failed and in response, attempting to execute the first set of operations as an atomic memory transaction in a second transactional mode, said executing the operations in a second transactional mode comprising; attempting to execute a second set of operations to acquire a subset of the plurality of locks associated with the partitions accessed by the first set of operations, wherein the second set of operations is executed as an atomic memory transaction in the first transactional mode; performing the first set of operations; and releasing the acquired locks. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
-
-
13. A system, comprising:
-
one or more processors; and a memory coupled to the processors, wherein the memory stores program instructions executable by the one or more processors to; partition at least a portion of shared memory accessible concurrently by a plurality of threads, into a plurality of partitions and associate the plurality of partitions with respective locks; a first of the plurality of threads attempting to execute a first set of operations as an atomic memory transaction, the first set of operations including accesses to one or more of the plurality of partitions, wherein the accesses are performed in a first transactional mode, said performing the accesses in the first transactional mode being dependent on reading but not on acquiring those of the plurality of locks associated with the one or more accessed partitions; receive an indication that the attempt to execute the first set of operations as an atomic memory transaction in the first transactional mode failed and in response, attempt to execute the first set of operations as an atomic memory transaction in a second transactional mode, said executing the operations in a second transactional mode comprising; attempting to execute a second set of operations to acquire a subset of the plurality of locks associated with the partitions accessed by the first set of operations, wherein the second set of operations is executed as an atomic memory transaction in the first transactional mode; perform the first set of operations; and release the acquired locks. - View Dependent Claims (14, 15, 16)
-
-
17. A computer readable storage medium, comprising program instructions, wherein the instructions are computer-executable to:
-
partition at least a portion of shared memory accessible concurrently by a plurality of threads, into a plurality of partitions and associate the plurality of partitions with respective locks; a first of the plurality of threads attempting to execute a first set of operations as an atomic memory transaction, the first set of operations including accesses to one or more of the plurality of partitions, wherein the accesses are performed in a first transactional mode, said performing the accesses in the first transactional mode being dependent on reading but not on acquiring those of the plurality of locks associated with the one or more accessed partitions; receive an indication that the attempt to execute the first set of operations as an atomic memory transaction in the first transactional mode failed and in response, attempt to execute the first set of operations as an atomic memory transaction in a second transactional mode, said executing the operations in a second transactional mode comprising; attempting to execute a second set of operations to acquire a subset of the plurality of locks associated with the partitions accessed by the first set of operations, wherein the second set of operations is executed as an atomic memory transaction in the first transactional mode; perform the first set of operations; and release the acquired locks. - View Dependent Claims (18, 19, 20)
-
Specification