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.