1. A computer-readable storage medium storing program instructions executable by one or more processors to implement: a compiler configured to compile program code for execution on a software transactional memory system, wherein the compilation comprises: determining that a group of data structures is accessed together within one or more atomic memory transactions defined in the program code; and in response to the determining, creating an executable version of the program code, wherein the executable version includes clustering code executable to associate the data structures in the group with a same software transactional memory lock, wherein the lock is usable by the software transactional memory system to coordinate concurrent transactional access to the group of data structures by multiple concurrent threads.