请输入您要查询的百科知识:

 

词条 Speculative execution
释义

  1. Overview

  2. Variants

     Eager execution  {{Anchor|PREDICTIVE}}Predictive execution  Lazy execution 

  3. Security vulnerabilities

  4. See also

  5. References

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,[1] prefetching memory and files, and optimistic concurrency control in database systems.[2][3][4]

Speculative multithreading is a special case of speculative execution.

Overview

Modern pipelined microprocessors use speculative execution to reduce the cost of conditional branch instructions using schemes that predict the execution path of a program based on the history of branch executions.[3] In order to improve performance and utilization of computer resources, instructions can be scheduled at a time when it has not yet been determined that the instructions will need to be executed, ahead of a branch.[5]

Variants

Speculative computation was a related earlier concept.[6]

Eager execution

{{See also|Eager evaluation}}

Eager execution is a form of speculative execution where both sides of the conditional branch are executed; however, the results are committed only if the predicate is true. With unlimited resources, eager execution (also known as oracle execution) would in theory provide the same performance as perfect branch prediction. With limited resources eager execution should be employed carefully since the number of resources needed grows exponentially with each level of branch executed eagerly.[7]

{{Anchor|PREDICTIVE}}Predictive execution

{{See also|Pipeline (computing)}}{{Main| Branch predictor}}

Predictive execution is a form of speculative execution where some outcome is predicted and execution proceeds along the predicted path until the actual result is known. If the prediction is true, the predicted execution is allowed to commit, however if there is a misprediction, execution has to be unrolled and re-executed. Common forms of this include branch predictors, and memory dependence prediction. A generalized form is sometimes referred to as value prediction.[1][8]

Lazy execution

{{Main|Lazy evaluation}}

Lazy execution does not involve speculation. The incorporation of speculative execution into implementations of the Haskell programming language is a current research topic. Eager Haskell is designed around the idea of speculative execution. A 2003 PhD thesis made GHC support a kind of speculative execution with an abortion mechanism to back out in case of a bad choice called optimistic execution.[9] It was deemed too complicated.[10]

Security vulnerabilities

{{Main|Meltdown (security vulnerability)|Foreshadow (security vulnerability)|Spectre (security vulnerability)}}{{Speculative execution exploits}}

See also

  • Branch predictor
  • Out-of-order execution
  • Slipstream (computer science)
  • Speculative multithreading

References

1. ^"[https://www.academia.edu/33619227/A_Survey_of_Value_Prediction_Techniques_for_Leveraging_Value_Locality A Survey of Value Prediction Techniques for Leveraging Value Locality]", S. Mittal, Concurrency and Computation, 2017
2. ^Lazy and Speculative Execution Butler Lampson Microsoft Research OPODIS, Bordeaux, France 12 December 2006
3. ^{{cite book|author1=International Business Machines Corporation. Research Division|author2=Prabhakar Raghavan|author3=Hadas Schachnai|author4=Mira Yaniv|title=Dynamic schemes for speculative execution of code|url=https://books.google.com/books?id=eBgMGwAACAAJ|accessdate=18 January 2011|year=1998|publisher=IBM}}
4. ^{{cite conference|authorlink= H. T. Kung|first= H. T. |last= Kung|author2=John T. Robinson|title= On optimistic methods for concurrency control|booktitle= ACM Trans. Database Syst.|volume= 6|number= 2|date=June 1981}}
5. ^{{cite book|author=Bernd Krieg-Brückner|title=ESOP '92: 4th European Symposium on Programming, Rennes, France, February 26-28, 1992: proceedings|url=https://books.google.com/books?id=AQbhbphyOsoC&pg=PA56|accessdate=18 January 2011|year=1992|publisher=Springer|isbn=978-3-540-55253-6|pages=56–57}}
6. ^{{cite web |url=http://www.hpl.hp.com/techreports/Compaq-DEC/CRL-90-1.html |title=Speculative Computation in Multilisp |author=Randy B. Osborne |date=1990-03-21 |publisher=Digital Equipment Corporation Research Lab |type=PS |doi=10.1007/BFb0024152 |accessdate=2018-01-26}}
7. ^{{cite book|author1=Jurij Šilc|author2=Borut Robič|author3=Theo Ungerer|title=Processor architecture: from dataflow to superscalar and beyond|url=https://books.google.com/books?id=JEYKyfZ3yF0C&pg=PA148|accessdate=21 January 2011|year=1999|publisher=Springer|isbn=978-3-540-64798-0|pages=148–150}}
8. ^{{cite book|last1=Mark D.|first1=Hill|last2=Norman P.|first2=Jouppi|last3=Gourindar S.|first3=Sohi|title=Readings in Computer Architecture|date=2000|publisher=Morgan Kaufman|url=https://books.google.it/books?id=I7o8teBhz5wC&pg=PA178&lpg=PA178&dq=processor+predictive+execution&source=bl&ots=Q5upm5D1AO&sig=ckP4Iw7LU2IhFivha4DPNVKW-i0&hl=it&sa=X&ved=0ahUKEwiO0K2oz7_YAhVFWCwKHflQC3wQ6AEIaTAH#v=onepage&q=processor%20predictive%20execution&f=false|accessdate=5 January 2018}}
9. ^Optimistic Evaluation: a fast evaluation strategy for non-strict programs
10. ^https://mail.haskell.org/pipermail/haskell/2006-August/018424.html
{{CPU technologies}}

3 : Instruction processing|Speculative execution|Concurrency (computer science)

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/13 19:13:09