Systems and Methods for Adaptive Integration of Hardware and Software Lock Elision Techniques
First Claim
1. A method, comprising:
- performing by a computer;
beginning execution of a multithreaded application;
while executing the application, a thread of the application encountering a critical section of code in the application that is associated with a lock, wherein when the lock is held by a thread, other threads are prevented from entering the critical section;
determining a context in which the critical section was encountered;
determining a policy that is applicable to the determined context, wherein the policy is usable in determining which of a plurality of integrated mechanisms for executing the critical section without acquiring the lock is to be employed in attempting to execute the critical section;
selecting one of the plurality of integrated mechanisms, dependent on the determined policy; and
the thread attempting to execute the critical section using the selected one of the plurality of integrated mechanisms.
1 Assignment
0 Petitions
Accused Products
Abstract
Particular techniques for improving the scalability of concurrent programs (e.g., lock-based applications) may be effective in some environments and for some workloads, but not others. The systems described herein may automatically choose appropriate ones of these techniques to apply when executing lock-based applications at runtime, based on observations of the application in the current environment and with the current workload. In one example, two techniques for improving lock scalability (e.g., transactional lock elision using hardware transactional memory, and optimistic software techniques) may be integrated together. A lightweight runtime library built for this purpose may adapt its approach to managing concurrency by dynamically selecting one or more of these techniques (at different times) during execution of a given application. In this Adaptive Lock Elision approach, the techniques may be selected (based on pluggable policies) at runtime to achieve good performance on different platforms and for different workloads.
-
Citations
20 Claims
-
1. A method, comprising:
performing by a computer; beginning execution of a multithreaded application; while executing the application, a thread of the application encountering a critical section of code in the application that is associated with a lock, wherein when the lock is held by a thread, other threads are prevented from entering the critical section; determining a context in which the critical section was encountered; determining a policy that is applicable to the determined context, wherein the policy is usable in determining which of a plurality of integrated mechanisms for executing the critical section without acquiring the lock is to be employed in attempting to execute the critical section; selecting one of the plurality of integrated mechanisms, dependent on the determined policy; and the thread attempting to execute the critical section using the selected one of the plurality of integrated mechanisms. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)
-
15. A system, comprising:
-
one or more processor cores; and a memory coupled to the one or more processor cores and storing program instructions that when executed on the one or more processor cores cause the one or more processor cores to perform; beginning execution of a concurrent application; while executing the application, a process of the application encountering a critical section of code in the application that is associated with a lock, wherein when the lock is held by a process, other processes are prevented from entering the critical section; determining a context in which the critical section was encountered; determining a policy that is applicable to the determined context, wherein the policy is usable in determining which of a plurality of integrated mechanisms for executing the critical section without acquiring the lock is to be employed in attempting to execute the critical section; selecting one of the plurality of integrated mechanisms, dependent on the determined context or the determined policy; and the process attempting to execute the critical section using the selected one of the plurality of integrated mechanisms. - View Dependent Claims (16, 17)
-
-
18. A non-transitory, computer-readable storage medium storing program instructions that when executed on one or more computers cause the one or more computers to perform:
-
beginning execution of a multithreaded application; while executing the application, a thread of the application encountering a critical section of code in the application that is associated with a lock, wherein when the lock is held by a thread, other threads are prevented from entering the critical section; determining a context in which the critical section was encountered; determining a policy that is applicable to the determined context, wherein the policy is usable in determining which of a plurality of integrated mechanisms for executing the critical section without acquiring the lock is to be employed in attempting to execute the critical section; selecting one of the plurality of integrated mechanisms, dependent on the determined context or the determined policy; and the thread attempting to execute the critical section using the selected one of the plurality of integrated mechanisms. - View Dependent Claims (19, 20)
-
Specification