<s>
Thread	B-Operating_System
Level	I-Operating_System
Speculation	I-Operating_System
(	O
TLS	O
)	O
,	O
also	O
known	O
as	O
Speculative	B-Operating_System
Multithreading	I-Operating_System
,	O
or	O
Speculative	O
Parallelization	B-Operating_System
,	O
is	O
a	O
technique	O
to	O
speculatively	B-General_Concept
execute	I-General_Concept
a	O
section	O
of	O
computer	O
code	O
that	O
is	O
anticipated	O
to	O
be	O
executed	O
later	O
in	O
parallel	O
with	O
the	O
normal	O
execution	O
on	O
a	O
separate	O
independent	O
thread	B-Operating_System
.	O
</s>
<s>
Such	O
a	O
speculative	O
thread	B-Operating_System
may	O
need	O
to	O
make	O
assumptions	O
about	O
the	O
values	O
of	O
input	O
variables	O
.	O
</s>
<s>
If	O
these	O
prove	O
to	O
be	O
invalid	O
,	O
then	O
the	O
portions	O
of	O
the	O
speculative	O
thread	B-Operating_System
that	O
rely	O
on	O
these	O
input	O
variables	O
will	O
need	O
to	O
be	O
discarded	O
and	O
squashed	O
.	O
</s>
<s>
If	O
the	O
assumptions	O
are	O
correct	O
the	O
program	O
can	O
complete	O
in	O
a	O
shorter	O
time	O
provided	O
the	O
thread	B-Operating_System
was	O
able	O
to	O
be	O
scheduled	O
efficiently	O
.	O
</s>
<s>
TLS	O
extracts	O
threads	B-Operating_System
from	O
serial	O
code	O
and	O
executes	O
them	O
speculatively	B-General_Concept
in	O
parallel	O
with	O
a	O
safe	O
thread	B-Operating_System
.	O
</s>
<s>
The	O
speculative	O
thread	B-Operating_System
will	O
need	O
to	O
be	O
discarded	O
or	O
re-run	O
if	O
its	O
presumptions	O
on	O
the	O
input	O
state	O
prove	O
to	O
be	O
invalid	O
.	O
</s>
<s>
It	O
is	O
a	O
dynamic	O
(	O
runtime	O
)	O
parallelization	B-Operating_System
technique	O
that	O
can	O
uncover	O
parallelism	B-Operating_System
that	O
static	O
(	O
compile-time	O
)	O
parallelization	B-Operating_System
techniques	O
may	O
fail	O
to	O
exploit	O
because	O
at	O
compile	O
time	O
thread	B-Operating_System
independence	O
cannot	O
be	O
guaranteed	O
.	O
</s>
<s>
For	O
the	O
technique	O
to	O
achieve	O
the	O
goal	O
of	O
reducing	O
overall	O
execute	O
time	O
,	O
there	O
must	O
be	O
available	O
CPU	O
resource	O
that	O
can	O
be	O
efficiently	O
executed	O
in	O
parallel	O
with	O
the	O
main	O
safe	O
thread	B-Operating_System
.	O
</s>
<s>
To	O
do	O
so	O
,	O
it	O
divides	O
the	O
iteration	O
space	O
into	O
chunks	O
that	O
are	O
executed	O
in	O
parallel	O
by	O
different	O
threads	B-Operating_System
.	O
</s>
<s>
If	O
a	O
dependence	O
violation	O
appears	O
,	O
the	O
speculative	O
framework	O
may	O
choose	O
to	O
stop	O
the	O
entire	O
parallel	O
execution	O
and	O
restart	O
it	O
;	O
to	O
stop	O
and	O
restart	O
the	O
offending	O
threads	B-Operating_System
and	O
all	O
their	O
successors	O
,	O
in	O
order	O
to	O
be	O
fed	O
with	O
correct	O
data	O
;	O
or	O
to	O
stop	O
exclusively	O
the	O
offending	O
thread	B-Operating_System
and	O
its	O
successors	O
that	O
have	O
consumed	O
incorrect	O
data	O
from	O
it	O
.	O
</s>
