1. A method comprising: maintaining an environment to execute multiple processing threads in parallel; during execution of the multiple processing threads, switching a manner of the execution between non-transactional memory usage in which the multiple processing threads compete to obtain a coarse-grained lock over a region of respective shared data, and transactional memory usage in which the multiple processing threads compete to obtain finer-grained locks over sub-portions of the respective shared data; and initiating the non-transactional memory usage to include global version information and a respective global lock bit accessible by the multiple processing threads, the global version information being updated by a respective processing thread each time the respective processing thread modifies contents of the respective shared data, the respective global lock bit enabling each of the multiple processing threads to obtain a lock over the respective shared data preventing other processing threads from modifying the contents of the shared data; and initiating the transactional memory usage to include a distributed lock mode, the distributed lock mode including corresponding segment version information and a respective segment lock bit for each of multiple segments of the respective shared data accessible by the multiple processing threads, the corresponding segment version information being updated by a respective processing thread each time the respective processing thread modifies contents of the corresponding segment of the respective shared data, the respective segment lock bit enabling each of the multiple processing threads to obtain a lock over the corresponding segment of the respective shared data preventing other processing threads from modifying the contents of the corresponding segment.