Adaptive queued locking for control of speculative execution
First Claim
Patent Images
1. An apparatus, comprising:
- a lock to;
enforce a first quota to control a number of threads allowed to concurrently speculatively execute a critical section of code after being placed in a queue;
enable a first thread corresponding to a head node of the queue to speculatively execute the critical section to increase a number of threads that are concurrently speculatively executing the critical section;
in response to a determination that a number of threads concurrently speculatively executing the critical section does not satisfy the first quota, dequeue the first thread to cause a second thread in the queue to correspond to the head node of the queue;
in response to a determination that the number of threads concurrently speculatively executing the critical section satisfies the first quota, maintain the first thread at the head node of the queue, the maintaining of the first thread at the head node to prevent a second thread corresponding to a second node of the queue from retrying speculative execution of the critical section; and
an adjuster to change a first value of the first quota based on a result of the speculative execution of the critical section by the first thread, wherein at least one of the lock or the adjuster is implemented via a logic circuit.
1 Assignment
0 Petitions
Accused Products
Abstract
Adaptive queued locking for control of speculative execution is disclosed. An example apparatus includes a lock to: enforce a first quota to control a number of threads allowed to concurrently speculatively execute after being placed in a queue; and in response to the first quota not having been reached, enable a first thread from the queue to speculatively execute; and an adjuster to change a first value of the first quota based on a result of the speculative execution of the first thread.
-
Citations
21 Claims
-
1. An apparatus, comprising:
-
a lock to; enforce a first quota to control a number of threads allowed to concurrently speculatively execute a critical section of code after being placed in a queue; enable a first thread corresponding to a head node of the queue to speculatively execute the critical section to increase a number of threads that are concurrently speculatively executing the critical section; in response to a determination that a number of threads concurrently speculatively executing the critical section does not satisfy the first quota, dequeue the first thread to cause a second thread in the queue to correspond to the head node of the queue; in response to a determination that the number of threads concurrently speculatively executing the critical section satisfies the first quota, maintain the first thread at the head node of the queue, the maintaining of the first thread at the head node to prevent a second thread corresponding to a second node of the queue from retrying speculative execution of the critical section; and an adjuster to change a first value of the first quota based on a result of the speculative execution of the critical section by the first thread, wherein at least one of the lock or the adjuster is implemented via a logic circuit. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A method, comprising:
-
enforcing, by executing an instruction with a processor, a first quota to control a number of threads allowed to concurrently speculatively execute a critical section of code, after being placed in a queue; enabling, by executing an instruction with the processor, a first thread corresponding to a head node of the queue to speculatively execute the critical section to increase the number of threads that are concurrently speculatively executing the critical section; in response to a determination by the first thread corresponding to a head node of the queue that a number of threads concurrently speculatively executing the critical section does not satisfy the first quota removing the first thread from the queue by removing a correspondence between the first thread and the head node; in response to a determination by the first thread that the number of threads concurrently speculatively executing the critical section satisfies the first quota, enabling, by executing an instruction with the processor, the first thread to speculatively execute the critical section while maintaining the first thread at the head node of the queue by maintaining the correspondence between the head node and the first thread, the maintaining the first thread at the head node of the queue to prevent a second thread corresponding to a second node of the queue from retrying speculative execution of the critical section; and changing, by executing an instruction with the processor, a first value of the first quota based on a result of the speculative execution of the critical section by the first thread. - View Dependent Claims (9, 10, 11, 12, 13, 14)
-
-
15. At least one tangible computer readable storage medium comprising instructions that, when executed, cause a machine to at least:
-
enforce a first quota to control a number of threads allowed to concurrently speculatively execute a critical section of code; in response to a determination, by a first thread corresponding to a head node of a queue, that the number of threads concurrently speculatively executing the critical section does not satisfy the first quota, enable the first thread to speculatively execute the critical section to increase the number of threads that are concurrently speculatively executing the critical section and dequeue the first thread by removing a correspondence between the first thread and the head node of the queue; in response to a determination by the first thread that the number of threads concurrently speculatively executing the critical section satisfies the first quota, enable the first thread to speculatively execute the critical section to increase the number of threads that are concurrently speculatively executing the critical section and maintain the correspondence between the first thread and the head node of the queue; and change a first value of the first quota based on a result of the speculative execution of the critical section by the first thread. - View Dependent Claims (16, 17, 18, 19, 20, 21)
-
Specification