Methods and apparatus to implement parallel transactions
First Claim
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.
2 Assignments
0 Petitions
Accused Products
Abstract
A computer system includes multiple processing threads that execute in parallel. The multiple processing threads have access to a global environment including different types of metadata enabling the processing threads to carry out simultaneous execution depending on a currently selected type of lock mode. A mode controller monitoring the processing threads initiates switching from one type of lock mode to another depending on current operating conditions such as an amount of contention amongst the multiple processing threads to modify the shared data. The mode controller can switch from one lock mode another regardless of whether any of the multiple processes are in the midst of executing a respective transaction. A most efficient lock mode can be selected to carry out the parallel transactions. In certain cases, switching of lock modes causes one or more of the processing threads to abort and retry a respective transaction according to the new mode.
32 Citations
14 Claims
-
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. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10)
-
-
11. A computer readable media encoded with a computer program including:
-
instructions to initiate execution of at least one processing thread of multiple processing threads executed in parallel; instructions to switch a manner of the execution of the at least one processing thread 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 instructions to initiate 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 instructions to initiate 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. - View Dependent Claims (12, 13)
-
-
14. A computer system including:
-
multiple processing threads executing in parallel; a global environment accessible by the multiple processing threads, the global environment including i) shared data utilized by the multiple processing threads, ii) mode setting information indicating a current lock mode for executing the multiple processing threads in parallel, the current lock mode being one of a first lock mode for implementing multi-lock based transactional memory usage and a second lock mode for implementing single-lock based memory usage of the shared data; wherein the second lock mode is a centralized lock mode in which the multiple processing threads compete to obtain a coarse-grained lock over the shared data; wherein the first lock mode is a distributed lock mode in which the multiple processing threads compete to obtain finer-grained locks over sub-portions of the shared data wherein the global environment includes; global lock information enabling a respective one of the multiple processing threads to obtain a respective lock and prevent other processing threads from modifying any of the shared data when in the first lock mode; and segment lock information for each of multiple segments of the region of shared data, the segment lock information enabling a respective one of the multiple processing threads to obtain a respective lock and prevent other processing threads from modifying contents of a corresponding segment of the shared data when in the second lock mode; global version information enabling a respective one of the multiple processing threads to identify whether contents of the shared data has been modified by another processing thread because each of the multiple processing threads updates a value of the global version information upon modification of the shared data when in the first lock mode; and segment version information for each of multiple segments of the shared data, the segment version information associated with the multiple segments enabling a respective one of the multiple processing threads to identify whether contents of any corresponding segments of the shared data have been modified by another processing thread because each of the multiple processing threads updates a value of corresponding segment version information upon modification of the corresponding segment of shared data when in the second lock mode.
-
Specification