Computer optimization technique
Speculative execution is an optimization technique where a computer system performs some task that may not be needed. Work is done before it is known whether it is actually needed, so as to prevent a delay that would have to be incurred by doing the work after it is known that it is needed. If it turns out the work was not needed after all, most changes made by the work are reverted and the results are ignored.
The objective is to provide more concurrency if extra resources are available. This approach is employed in a variety of areas, including branch prediction in pipelined processors , value prediction for exploiting value locality, prefetching memory and files , and optimistic concurrency control in database systems .[ 1] [ 2] [ 3]
Speculative multithreading is a special case of speculative execution.
^ Lampson, Butler (2006). "Lazy and Speculative Execution in Computer Systems" . In Momenzadeh, Mariam; Shvartsman, Alexander A. (eds.). Principles of Distributed Systems . 10th International Conference on Principles of Distributed Systems. Lecture Notes in Computer Science. Vol. 4305. Bordeaux, France: Springer. pp. 1–2. doi :10.1007/11945529_1 . ISBN 978-3-540-49991-6 .
^ Raghavan, Prabhakar; Shachnai, Hadas; Yaniv, Mira (1998). "Dynamic schemes for speculative execution of code" . Proceedings of the Sixth International Symposium on Modeling, Analysis and Simulation of Computer and Telecommunication Systems . IEEE. pp. 309–314. doi :10.1109/MASCOT.1998.693711 . Retrieved 18 January 2011 .
^
Kung, H. T. ; John T. Robinson (June 1981). "On optimistic methods for concurrency control" (PDF) . ACM Trans. Database Syst . Vol. 6. Archived (PDF) from the original on August 31, 2019.