<s>
Speculative	B-General_Concept
execution	I-General_Concept
is	O
an	O
optimization	O
technique	O
where	O
a	O
computer	O
system	O
performs	O
some	O
task	O
that	O
may	O
not	O
be	O
needed	O
.	O
</s>
<s>
The	O
objective	O
is	O
to	O
provide	O
more	O
concurrency	B-Operating_System
if	O
extra	O
resources	B-General_Concept
are	O
available	O
.	O
</s>
<s>
This	O
approach	O
is	O
employed	O
in	O
a	O
variety	O
of	O
areas	O
,	O
including	O
branch	B-General_Concept
prediction	I-General_Concept
in	O
pipelined	B-General_Concept
processors	I-General_Concept
,	O
value	O
prediction	O
for	O
exploiting	O
value	O
locality	O
,	O
prefetching	O
memory	B-General_Concept
and	O
files	B-Application
,	O
and	O
optimistic	B-Operating_System
concurrency	I-Operating_System
control	I-Operating_System
in	O
database	B-Application
systems	I-Application
.	O
</s>
<s>
Speculative	B-Operating_System
multithreading	I-Operating_System
is	O
a	O
special	O
case	O
of	O
speculative	B-General_Concept
execution	I-General_Concept
.	O
</s>
<s>
Modern	O
pipelined	B-General_Concept
microprocessors	B-Architecture
use	O
speculative	B-General_Concept
execution	I-General_Concept
to	O
reduce	O
the	O
cost	O
of	O
conditional	B-General_Concept
branch	I-General_Concept
instructions	O
using	O
schemes	O
that	O
predict	O
the	O
execution	O
path	O
of	O
a	O
program	O
based	O
on	O
the	O
history	O
of	O
branch	B-General_Concept
executions	O
.	O
</s>
<s>
In	O
order	O
to	O
improve	O
performance	O
and	O
utilization	O
of	O
computer	O
resources	B-General_Concept
,	O
instructions	O
can	O
be	O
scheduled	O
at	O
a	O
time	O
when	O
it	O
has	O
not	O
yet	O
been	O
determined	O
that	O
the	O
instructions	O
will	O
need	O
to	O
be	O
executed	O
,	O
ahead	O
of	O
a	O
branch	B-General_Concept
.	O
</s>
<s>
Speculative	B-General_Concept
computation	I-General_Concept
was	O
a	O
related	O
earlier	O
concept	O
.	O
</s>
<s>
Eager	O
execution	O
is	O
a	O
form	O
of	O
speculative	B-General_Concept
execution	I-General_Concept
where	O
both	O
sides	O
of	O
the	O
conditional	B-General_Concept
branch	I-General_Concept
are	O
executed	O
;	O
however	O
,	O
the	O
results	O
are	O
committed	O
only	O
if	O
the	O
predicate	O
is	O
true	O
.	O
</s>
<s>
With	O
unlimited	O
resources	B-General_Concept
,	O
eager	O
execution	O
(	O
also	O
known	O
as	O
oracle	O
execution	O
)	O
would	O
in	O
theory	O
provide	O
the	O
same	O
performance	O
as	O
perfect	O
branch	B-General_Concept
prediction	I-General_Concept
.	O
</s>
<s>
With	O
limited	O
resources	B-General_Concept
,	O
eager	O
execution	O
should	O
be	O
employed	O
carefully	O
,	O
since	O
the	O
number	O
of	O
resources	B-General_Concept
needed	O
grows	O
exponentially	O
with	O
each	O
level	O
of	O
branch	B-General_Concept
executed	O
eagerly	O
.	O
</s>
<s>
Predictive	O
execution	O
is	O
a	O
form	O
of	O
speculative	B-General_Concept
execution	I-General_Concept
where	O
some	O
outcome	O
is	O
predicted	O
and	O
execution	O
proceeds	O
along	O
the	O
predicted	O
path	O
until	O
the	O
actual	O
result	O
is	O
known	O
.	O
</s>
<s>
If	O
the	O
prediction	O
is	O
true	O
,	O
the	O
predicted	O
execution	O
is	O
allowed	O
to	O
commit	O
;	O
however	O
,	O
if	O
there	O
is	O
a	O
misprediction	B-General_Concept
,	O
execution	O
has	O
to	O
be	O
unrolled	O
and	O
re-executed	O
.	O
</s>
<s>
Common	O
forms	O
of	O
this	O
include	O
branch	B-General_Concept
predictors	I-General_Concept
and	O
memory	B-Architecture
dependence	I-Architecture
prediction	I-Architecture
.	O
</s>
<s>
The	O
incorporation	O
of	O
speculative	B-General_Concept
execution	I-General_Concept
into	O
implementations	O
of	O
the	O
Haskell	B-Language
programming	I-Language
language	I-Language
,	O
a	O
lazy	O
language	O
,	O
is	O
a	O
current	O
research	O
topic	O
.	O
</s>
<s>
Eager	O
Haskell	B-Language
,	O
a	O
variant	O
of	O
the	O
language	O
,	O
is	O
designed	O
around	O
the	O
idea	O
of	O
speculative	B-General_Concept
execution	I-General_Concept
.	O
</s>
<s>
A	O
2003	O
PhD	O
thesis	O
made	O
GHC	B-Application
support	O
a	O
kind	O
of	O
speculative	B-General_Concept
execution	I-General_Concept
with	O
an	O
abortion	O
mechanism	O
to	O
back	O
out	O
in	O
case	O
of	O
a	O
bad	O
choice	O
called	O
optimistic	O
execution	O
.	O
</s>
<s>
Starting	O
in	O
2017	O
,	O
a	O
series	O
of	O
security	O
vulnerabilities	O
were	O
found	O
in	O
the	O
implementations	O
of	O
speculative	B-General_Concept
execution	I-General_Concept
on	O
common	O
processor	O
architectures	O
which	O
effectively	O
enabled	O
an	O
elevation	O
of	O
privileges	O
.	O
</s>
