<s>
Cilk	B-Language
,	O
Cilk++	B-Language
,	O
Cilk	B-Language
Plus	O
and	O
OpenCilk	O
are	O
general-purpose	B-Language
programming	I-Language
languages	I-Language
designed	O
for	O
multithreaded	B-Operating_System
parallel	B-Operating_System
computing	I-Operating_System
.	O
</s>
<s>
They	O
are	O
based	O
on	O
the	O
C	B-Language
and	O
C++	B-Language
programming	I-Language
languages	I-Language
,	O
which	O
they	O
extend	O
with	O
constructs	O
to	O
express	O
parallel	B-Operating_System
loops	O
and	O
the	O
fork	B-Operating_System
–	I-Operating_System
join	I-Operating_System
idiom	I-Operating_System
.	O
</s>
<s>
Originally	O
developed	O
in	O
the	O
1990s	O
at	O
the	O
Massachusetts	O
Institute	O
of	O
Technology	O
(	O
MIT	O
)	O
in	O
the	O
group	O
of	O
Charles	O
E	O
.	O
Leiserson	O
,	O
Cilk	B-Language
was	O
later	O
commercialized	O
as	O
Cilk++	B-Language
by	O
a	O
spinoff	O
company	O
,	O
Cilk	B-Language
Arts	O
.	O
</s>
<s>
That	O
company	O
was	O
subsequently	O
acquired	O
by	O
Intel	O
,	O
which	O
increased	O
compatibility	O
with	O
existing	O
C	B-Language
and	O
C++	B-Language
code	I-Language
,	O
calling	O
the	O
result	O
Cilk	B-Language
Plus	O
.	O
</s>
<s>
After	O
Intel	O
stopped	O
supporting	O
Cilk	B-Language
Plus	O
in	O
2017	O
,	O
MIT	O
is	O
again	O
developing	O
Cilk	B-Language
in	O
the	O
form	O
of	O
OpenCilk	O
.	O
</s>
<s>
The	O
Cilk	B-Language
programming	I-Language
language	I-Language
grew	O
out	O
of	O
three	O
separate	O
projects	O
at	O
the	O
MIT	O
Laboratory	O
for	O
Computer	O
Science	O
:	O
</s>
<s>
Theoretical	O
work	O
on	O
scheduling	O
multi-threaded	B-Operating_System
applications	O
.	O
</s>
<s>
StarTech	O
–	O
a	O
parallel	B-Operating_System
chess	B-Application
program	I-Application
built	O
to	O
run	O
on	O
the	O
Thinking	O
Machines	O
Corporation	O
's	O
Connection	O
Machine	O
model	O
CM-5	O
.	O
</s>
<s>
In	O
April	O
1994	O
the	O
three	O
projects	O
were	O
combined	O
and	O
christened	O
"	O
Cilk	B-Language
"	O
.	O
</s>
<s>
The	O
name	O
Cilk	B-Language
is	O
not	O
an	O
acronym	O
,	O
but	O
an	O
allusion	O
to	O
"	O
nice	O
threads	B-Operating_System
"	O
(	O
silk	O
)	O
and	O
the	O
C	B-Language
programming	I-Language
language	I-Language
.	O
</s>
<s>
The	O
Cilk-1	O
compiler	O
was	O
released	O
in	O
September	O
1994	O
.	O
</s>
<s>
The	O
original	O
Cilk	B-Language
language	O
was	O
based	O
on	O
ANSI	O
C	B-Language
,	O
with	O
the	O
addition	O
of	O
Cilk-specific	O
keywords	O
to	O
signal	O
parallelism	B-Operating_System
.	O
</s>
<s>
When	O
the	O
Cilk	B-Language
keywords	O
are	O
removed	O
from	O
Cilk	B-Language
source	O
code	O
,	O
the	O
result	O
should	O
always	O
be	O
a	O
valid	O
C	B-Language
program	I-Language
,	O
called	O
the	O
serial	O
elision	O
(	O
or	O
C	B-Language
elision	O
)	O
of	O
the	O
full	O
Cilk	B-Language
program	O
,	O
with	O
the	O
same	O
semantics	O
as	O
the	O
Cilk	B-Language
program	O
running	O
on	O
a	O
single	O
processor	O
.	O
</s>
<s>
Despite	O
several	O
similarities	O
,	O
Cilk	B-Language
is	O
not	O
directly	O
related	O
to	O
AT&T	O
Bell	O
Labs	O
 '	O
Concurrent	B-Operating_System
C	B-Language
.	O
</s>
<s>
Cilk	B-Language
was	O
implemented	O
as	O
a	O
translator	O
to	O
C	B-Language
,	O
targeting	O
the	O
GNU	B-Application
C	I-Application
Compiler	I-Application
(	O
GCC	B-Application
)	O
.	O
</s>
<s>
The	O
last	O
version	O
,	O
Cilk	B-Language
5.4.6	O
,	O
is	O
available	O
from	O
the	O
MIT	O
Computer	O
Science	O
and	O
Artificial	O
Intelligence	O
Laboratory	O
(	O
CSAIL	O
)	O
,	O
but	O
is	O
no	O
longer	O
supported	O
.	O
</s>
<s>
A	O
showcase	O
for	O
Cilk	B-Language
's	O
capabilities	O
was	O
the	O
Cilkchess	O
parallel	B-Operating_System
chess-playing	B-Application
program	I-Application
,	O
which	O
won	O
several	O
computer	B-Application
chess	I-Application
prizes	O
in	O
the	O
1990s	O
,	O
including	O
the	O
1996	O
Open	O
Dutch	O
Computer	B-Application
Chess	I-Application
Championship	O
.	O
</s>
<s>
Prior	O
to	O
,	O
the	O
market	O
for	O
Cilk	B-Language
was	O
restricted	O
to	O
high-performance	O
computing	O
.	O
</s>
<s>
The	O
emergence	O
of	O
multicore	O
processors	O
in	O
mainstream	O
computing	O
meant	O
that	O
hundreds	O
of	O
millions	O
of	O
new	O
parallel	B-Operating_System
computers	I-Operating_System
were	O
being	O
shipped	O
every	O
year	O
.	O
</s>
<s>
Cilk	B-Language
Arts	O
was	O
formed	O
to	O
capitalize	O
on	O
that	O
opportunity	O
:	O
in	O
2006	O
,	O
Leiserson	O
launched	O
Cilk	B-Language
Arts	O
to	O
create	O
and	O
bring	O
to	O
market	O
a	O
modern	O
version	O
of	O
Cilk	B-Language
that	O
supports	O
the	O
commercial	O
needs	O
of	O
an	O
upcoming	O
generation	O
of	O
programmers	O
.	O
</s>
<s>
The	O
company	O
closed	O
a	O
Series	O
A	O
venture	O
financing	O
round	O
in	O
October	O
2007	O
,	O
and	O
its	O
product	O
,	O
Cilk++	B-Language
1.0	O
,	O
shipped	O
in	O
December	O
,	O
2008	O
.	O
</s>
<s>
Cilk++	B-Language
differs	O
from	O
Cilk	B-Language
in	O
several	O
ways	O
:	O
support	O
for	O
C++	B-Language
,	O
support	O
for	O
loops	O
,	O
and	O
hyperobjects	O
a	O
new	O
construct	O
designed	O
to	O
solve	O
data	O
race	O
problems	O
created	O
by	O
parallel	B-Operating_System
accesses	O
to	O
global	O
variables	O
.	O
</s>
<s>
Cilk++	B-Language
was	O
proprietary	B-Application
software	I-Application
.	O
</s>
<s>
Like	O
its	O
predecessor	O
,	O
it	O
was	O
implemented	O
as	O
a	O
Cilk-to-C	O
++	O
compiler	O
.	O
</s>
<s>
It	O
supported	O
the	O
Microsoft	B-Application
and	O
GNU	B-Application
compilers	I-Application
.	O
</s>
<s>
On	O
July	O
31	O
,	O
2009	O
,	O
Cilk	B-Language
Arts	O
announced	O
on	O
its	O
web	O
site	O
that	O
its	O
products	O
and	O
engineering	O
team	O
were	O
now	O
part	O
of	O
Intel	O
Corp	O
.	O
</s>
<s>
In	O
early	O
2010	O
,	O
the	O
Cilk	B-Language
website	O
at	O
www.cilk.com	O
began	O
redirecting	O
to	O
the	O
Intel	O
website	O
(	O
as	O
of	O
early	O
2017	O
,	O
the	O
original	O
Cilk	B-Language
website	O
no	O
longer	O
resolves	O
to	O
a	O
host	O
)	O
.	O
</s>
<s>
Intel	O
and	O
Cilk	B-Language
Arts	O
integrated	O
and	O
advanced	O
the	O
technology	O
further	O
resulting	O
in	O
a	O
September	O
2010	O
release	O
of	O
Intel	B-Language
Cilk	I-Language
Plus	I-Language
.	O
</s>
<s>
Cilk	B-Language
Plus	O
adopts	O
simplifications	O
,	O
proposed	O
by	O
Cilk	B-Language
Arts	O
in	O
Cilk++	B-Language
,	O
to	O
eliminate	O
the	O
need	O
for	O
several	O
of	O
the	O
original	O
Cilk	B-Language
keywords	O
while	O
adding	O
the	O
ability	O
to	O
spawn	B-Language
functions	O
and	O
to	O
deal	O
with	O
variables	O
involved	O
in	O
reduction	O
operations	O
.	O
</s>
<s>
Cilk	B-Language
Plus	O
differs	O
from	O
Cilk	B-Language
and	O
Cilk++	B-Language
by	O
adding	O
array	O
extensions	O
,	O
being	O
incorporated	O
in	O
a	O
commercial	O
compiler	O
(	O
from	O
Intel	O
)	O
,	O
and	O
compatibility	O
with	O
existing	O
debuggers	O
.	O
</s>
<s>
Cilk	B-Language
Plus	O
was	O
first	O
implemented	O
in	O
the	O
Intel	B-Language
C++	I-Language
Compiler	I-Language
with	O
the	O
release	O
of	O
the	O
Intel	O
compiler	O
in	O
Intel	O
Composer	O
XE	O
2010	O
.	O
</s>
<s>
An	O
open	O
source	O
(	O
BSD-licensed	B-Operating_System
)	O
implementation	O
was	O
contributed	O
by	O
Intel	O
to	O
the	O
GNU	B-Application
Compiler	I-Application
Collection	I-Application
(	O
GCC	B-Application
)	O
,	O
which	O
shipped	O
Cilk	B-Language
Plus	O
support	O
in	O
version	O
4.9	O
,	O
except	O
for	O
the	O
keyword	O
,	O
which	O
was	O
added	O
in	O
GCC	B-Application
5.0	O
.	O
</s>
<s>
In	O
February	O
2013	O
,	O
Intel	O
announced	O
a	O
Clang	B-Application
fork	B-Application
with	O
Cilk	B-Language
Plus	O
support	O
.	O
</s>
<s>
The	O
Intel	O
Compiler	O
,	O
but	O
not	O
the	O
open	O
source	O
implementations	O
,	O
comes	O
with	O
a	O
race	B-Operating_System
detector	I-Operating_System
and	O
a	O
performance	O
analyzer	O
.	O
</s>
<s>
Intel	O
later	O
discontinued	O
it	O
,	O
recommending	O
its	O
users	O
switch	O
to	O
instead	O
using	O
either	O
OpenMP	B-Application
or	O
Intel	B-Application
's	I-Application
own	I-Application
TBB	I-Application
library	I-Application
for	O
their	O
parallel	B-Operating_System
programming	I-Operating_System
needs	O
.	O
</s>
<s>
In	O
the	O
original	O
MIT	O
Cilk	B-Language
implementation	O
,	O
the	O
first	O
Cilk	B-Language
keyword	O
is	O
in	O
fact	O
cilk	B-Language
,	O
which	O
identifies	O
a	O
function	O
which	O
is	O
written	O
in	O
Cilk	B-Language
.	O
</s>
<s>
Since	O
Cilk	B-Language
procedures	O
can	O
call	O
C	B-Language
procedures	O
directly	O
,	O
but	O
C	B-Language
procedures	O
cannot	O
directly	O
call	O
or	O
spawn	B-Language
Cilk	B-Language
procedures	O
,	O
this	O
keyword	O
is	O
needed	O
to	O
distinguish	O
Cilk	B-Language
code	O
from	O
C	B-Language
code	O
.	O
</s>
<s>
Cilk	B-Language
Plus	O
removes	O
this	O
restriction	O
,	O
as	O
well	O
as	O
the	O
cilk	B-Language
keyword	O
,	O
so	O
C	B-Language
and	O
C++	B-Language
functions	O
can	O
call	O
into	O
Cilk	B-Language
Plus	O
code	O
and	O
vice	O
versa	O
.	O
</s>
<s>
In	O
May	O
,	O
2017	O
,	O
GCC	B-Application
7.1	O
was	O
released	O
and	O
marked	O
Cilk	B-Language
Plus	O
support	O
as	O
deprecated	O
.	O
</s>
<s>
Intel	O
itself	O
announced	O
in	O
September	O
2017	O
that	O
they	O
would	O
deprecate	O
Cilk	B-Language
Plus	O
with	O
the	O
2018	O
release	O
of	O
the	O
Intel	O
Software	O
Development	O
Tools	O
.	O
</s>
<s>
In	O
May	O
2018	O
,	O
GCC	B-Application
8.1	O
was	O
released	O
with	O
Cilk	B-Language
Plus	O
support	O
removed	O
.	O
</s>
<s>
After	O
Cilk	B-Language
Plus	O
support	O
was	O
deprecated	O
by	O
Intel	O
,	O
MIT	O
has	O
taken	O
on	O
the	O
development	O
of	O
Cilk	B-Language
in	O
the	O
OpenCilk	O
implementation	O
,	O
focusing	O
on	O
the	O
LLVM/Clang	O
fork	B-Application
now	O
termed	O
"	O
Tapir	O
"	O
.	O
</s>
<s>
OpenCilk	O
remains	O
largely	O
compatible	O
with	O
Intel	B-Language
Cilk	I-Language
Plus	I-Language
.	O
</s>
<s>
The	O
principle	O
behind	O
the	O
design	O
of	O
the	O
Cilk	B-Language
language	O
is	O
that	O
the	O
programmer	O
should	O
be	O
responsible	O
for	O
exposing	O
the	O
parallelism	B-Operating_System
,	O
identifying	O
elements	O
that	O
can	O
safely	O
be	O
executed	O
in	O
parallel	B-Operating_System
;	O
it	O
should	O
then	O
be	O
left	O
to	O
the	O
run-time	O
environment	O
,	O
particularly	O
the	O
scheduler	O
,	O
to	O
decide	O
during	O
execution	O
how	O
to	O
actually	O
divide	O
the	O
work	O
between	O
processors	O
.	O
</s>
<s>
It	O
is	O
because	O
these	O
responsibilities	O
are	O
separated	O
that	O
a	O
Cilk	B-Language
program	O
can	O
run	O
without	O
rewriting	O
on	O
any	O
number	O
of	O
processors	O
,	O
including	O
one	O
.	O
</s>
<s>
Cilk	B-Language
's	O
main	O
addition	O
to	O
C	B-Language
are	O
two	O
keywords	O
that	O
together	O
allow	O
writing	O
task-parallel	O
programs	O
.	O
</s>
<s>
The	O
keyword	O
,	O
when	O
preceding	O
a	O
function	O
call	O
(	O
)	O
,	O
indicates	O
that	O
the	O
function	O
call	O
(	O
)	O
can	O
safely	O
run	O
in	O
parallel	B-Operating_System
with	O
the	O
statements	O
following	O
it	O
in	O
the	O
calling	O
function	O
.	O
</s>
<s>
Note	O
that	O
the	O
scheduler	O
is	O
not	O
obligated	O
to	O
run	O
this	O
procedure	O
in	O
parallel	B-Operating_System
;	O
the	O
keyword	O
merely	O
alerts	O
the	O
scheduler	O
that	O
it	O
can	O
do	O
so	O
.	O
</s>
<s>
This	O
is	O
an	O
example	O
of	O
a	O
barrier	B-Operating_System
method	O
.	O
</s>
<s>
(	O
In	O
Cilk	B-Language
Plus	O
,	O
the	O
keywords	O
are	O
spelled	O
and	O
,	O
or	O
and	O
if	O
the	O
Cilk	B-Language
Plus	O
headers	O
are	O
included	O
.	O
)	O
</s>
<s>
Below	O
is	O
a	O
recursive	O
implementation	O
of	O
the	O
Fibonacci	B-Algorithm
function	O
in	O
Cilk	B-Language
,	O
with	O
parallel	B-Operating_System
recursive	O
calls	O
,	O
which	O
demonstrates	O
the	O
,	O
and	O
keywords	O
.	O
</s>
<s>
The	O
original	O
Cilk	B-Language
required	O
any	O
function	O
using	O
these	O
to	O
be	O
annotated	O
with	O
the	O
keyword	O
,	O
which	O
is	O
gone	O
as	O
of	O
Cilk	B-Language
Plus	O
.	O
</s>
<s>
(	O
Cilk	B-Language
program	O
code	O
is	O
not	O
numbered	O
;	O
the	O
numbers	O
have	O
been	O
added	O
only	O
to	O
make	O
the	O
discussion	O
easier	O
to	O
follow	O
.	O
)	O
</s>
<s>
Even	O
though	O
the	O
common	O
terminology	O
for	O
discussing	O
Cilk	B-Language
refers	O
to	O
processors	O
making	O
the	O
decision	O
to	O
spawn	B-Language
off	O
work	O
to	O
other	O
processors	O
,	O
it	O
is	O
actually	O
the	O
scheduler	O
which	O
assigns	O
procedures	O
to	O
processors	O
for	O
execution	O
,	O
using	O
a	O
policy	O
called	O
work-stealing	O
,	O
described	O
later	O
.	O
)	O
</s>
<s>
The	O
code	O
example	O
above	O
uses	O
the	O
syntax	O
of	O
Cilk-5	O
.	O
</s>
<s>
The	O
original	O
Cilk	B-Language
(	O
Cilk-1	O
)	O
used	O
a	O
rather	O
different	O
syntax	O
that	O
required	O
programming	O
in	O
an	O
explicit	O
continuation-passing	B-Application
style	I-Application
,	O
and	O
the	O
Fibonacci	B-Algorithm
examples	O
looks	O
as	O
follows	O
:	O
</s>
<s>
Inside	O
'	O
s	O
recursive	O
case	O
,	O
the	O
keyword	O
indicates	O
the	O
creation	O
of	O
a	O
successor	O
thread	B-Operating_System
(	O
as	O
opposed	O
to	O
the	O
child	O
threads	B-Operating_System
created	O
by	O
)	O
,	O
which	O
executes	O
the	O
subroutine	O
after	O
waiting	O
for	O
the	O
continuation	O
variables	O
and	O
to	O
be	O
filled	O
in	O
by	O
the	O
recursive	O
calls	O
.	O
</s>
<s>
The	O
base	O
case	O
and	O
use	O
a	O
operation	O
to	O
set	O
their	O
continuation	O
variable	O
to	O
the	O
value	O
of	O
,	O
effectively	O
"	O
returning	O
"	O
the	O
value	O
to	O
the	O
successor	O
thread	B-Operating_System
.	O
</s>
<s>
The	O
two	O
remaining	O
Cilk	B-Language
keywords	O
are	O
slightly	O
more	O
advanced	O
,	O
and	O
concern	O
the	O
use	O
of	O
inlets	O
.	O
</s>
<s>
Ordinarily	O
,	O
when	O
a	O
Cilk	B-Language
procedure	O
is	O
spawned	O
,	O
it	O
can	O
return	O
its	O
results	O
to	O
the	O
parent	O
procedure	O
only	O
by	O
putting	O
those	O
results	O
in	O
a	O
variable	O
in	O
the	O
parent	O
's	O
frame	O
,	O
as	O
we	O
assigned	O
the	O
results	O
of	O
our	O
spawned	O
procedure	O
calls	O
in	O
the	O
example	O
to	O
x	O
and	O
y	O
.	O
</s>
<s>
An	O
inlet	O
is	O
a	O
function	O
internal	O
to	O
a	O
Cilk	B-Language
procedure	O
which	O
handles	O
the	O
results	O
of	O
a	O
spawned	O
procedure	O
call	O
as	O
they	O
return	O
.	O
</s>
<s>
Inlets	O
were	O
removed	O
when	O
Cilk	B-Language
became	O
Cilk++	B-Language
,	O
and	O
are	O
not	O
present	O
in	O
Cilk	B-Language
Plus	O
.	O
</s>
<s>
Cilk++	B-Language
added	O
an	O
additional	O
construct	O
,	O
the	O
parallel	B-Operating_System
loop	O
,	O
denoted	O
in	O
Cilk	B-Language
Plus	O
.	O
</s>
<s>
This	O
implements	O
the	O
parallel	B-Operating_System
map	I-Operating_System
idiom	O
:	O
the	O
body	O
of	O
the	O
loop	O
,	O
here	O
a	O
call	O
to	O
followed	O
by	O
an	O
assignment	O
to	O
the	O
array	O
,	O
is	O
executed	O
for	O
each	O
value	O
of	O
from	O
zero	O
to	O
in	O
an	O
indeterminate	O
order	O
.	O
</s>
<s>
The	O
reasons	O
for	O
generating	O
a	O
divide-and-conquer	O
program	O
rather	O
than	O
the	O
obvious	O
alternative	O
,	O
a	O
loop	O
that	O
spawn-calls	O
the	O
loop	O
body	O
as	O
a	O
function	O
,	O
lie	O
in	O
both	O
the	O
grainsize	O
handling	O
and	O
in	O
efficiency	O
:	O
doing	O
all	O
the	O
spawning	O
in	O
a	O
single	O
task	O
makes	O
load	O
balancing	O
a	O
bottleneck	O
.	O
</s>
<s>
A	O
review	O
of	O
various	O
parallel	B-Operating_System
loop	O
constructs	O
on	O
HPCwire	O
found	O
the	O
construct	O
to	O
be	O
quite	O
general	O
,	O
but	O
noted	O
that	O
the	O
Cilk	B-Language
Plus	O
specification	O
did	O
not	O
stipulate	O
that	O
its	O
iterations	O
need	O
to	O
be	O
data-independent	O
,	O
so	O
a	O
compiler	O
cannot	O
automatically	B-General_Concept
vectorize	I-General_Concept
a	O
loop	O
.	O
</s>
<s>
Cilk++	B-Language
added	O
a	O
kind	O
of	O
objects	O
called	O
hyperobjects	O
,	O
that	O
allow	O
multiple	O
strands	O
to	O
share	O
state	O
without	O
race	B-Operating_System
conditions	I-Operating_System
and	O
without	O
using	O
explicit	O
locks	O
.	O
</s>
<s>
The	O
most	O
common	O
type	O
of	O
hyperobject	O
is	O
a	O
reducer	O
,	O
which	O
corresponds	O
to	O
the	O
reduction	O
clause	O
in	O
OpenMP	B-Application
or	O
to	O
the	O
algebraic	O
notion	O
of	O
a	O
monoid	O
.	O
</s>
<s>
This	O
reducer	O
is	O
built	O
into	O
Cilk++	B-Language
and	O
Cilk	B-Language
Plus	O
:	O
</s>
<s>
Other	O
reducers	O
can	O
be	O
used	O
to	O
construct	O
linked	B-Data_Structure
lists	I-Data_Structure
or	O
strings	O
,	O
and	O
programmers	O
can	O
define	O
custom	O
reducers	O
.	O
</s>
<s>
A	O
limitation	O
of	O
hyperobjects	O
is	O
that	O
they	O
provide	O
only	O
limited	O
determinacy	B-Application
.	O
</s>
<s>
Intel	B-Language
Cilk	I-Language
Plus	I-Language
allows	O
C/C	O
++	O
operations	O
to	O
be	O
applied	O
to	O
multiple	O
array	O
elements	O
in	O
parallel	B-Operating_System
,	O
and	O
also	O
provides	O
a	O
set	O
of	O
built-in	O
functions	O
that	O
can	O
be	O
used	O
to	O
perform	O
vectorized	O
shifts	O
,	O
rotates	O
,	O
and	O
reductions	O
.	O
</s>
<s>
Similar	O
functionality	O
exists	O
in	O
Fortran	O
90	O
;	O
Cilk	B-Language
Plus	O
differs	O
in	O
that	O
it	O
never	O
allocates	O
temporary	O
arrays	O
,	O
so	O
memory	O
usage	O
is	O
easier	O
to	O
predict	O
.	O
</s>
<s>
In	O
Cilk	B-Language
Plus	O
,	O
an	O
elemental	O
function	O
is	O
a	O
regular	O
function	O
which	O
can	O
be	O
invoked	O
either	O
on	O
scalar	O
arguments	O
or	O
on	O
array	O
elements	O
in	O
parallel	B-Operating_System
.	O
</s>
<s>
They	O
are	O
similar	O
to	O
the	O
kernel	O
functions	O
of	O
OpenCL	B-Application
.	O
</s>
<s>
This	O
pragma	O
gives	O
the	O
compiler	O
permission	O
to	O
vectorize	O
a	O
loop	O
even	O
in	O
cases	O
where	O
auto-vectorization	B-General_Concept
might	O
fail	O
.	O
</s>
<s>
The	O
Cilk	B-Language
scheduler	O
uses	O
a	O
policy	O
called	O
"	O
work-stealing	O
"	O
to	O
divide	O
procedure	O
execution	O
efficiently	O
among	O
multiple	O
processors	O
.	O
</s>
<s>
Again	O
,	O
it	O
is	O
easiest	O
to	O
understand	O
if	O
we	O
look	O
first	O
at	O
how	O
Cilk	B-Language
code	O
is	O
executed	O
on	O
a	O
single-processor	O
machine	O
.	O
</s>
<s>
The	O
processor	O
maintains	O
a	O
stack	B-General_Concept
on	O
which	O
it	O
places	O
each	O
frame	O
that	O
it	O
has	O
to	O
suspend	O
in	O
order	O
to	O
handle	O
a	O
procedure	O
call	O
.	O
</s>
<s>
If	O
it	O
is	O
executing	O
fib(2 )	O
,	O
and	O
encounters	O
a	O
recursive	O
call	O
to	O
fib(1 )	O
,	O
it	O
will	O
save	O
fib(2 )	O
'	O
s	O
state	O
,	O
including	O
its	O
variables	O
and	O
where	O
the	O
code	O
suspended	O
execution	O
,	O
and	O
put	O
that	O
state	O
on	O
the	O
stack	B-General_Concept
.	O
</s>
<s>
It	O
will	O
not	O
take	O
a	O
suspended	O
state	O
off	O
the	O
stack	B-General_Concept
and	O
resume	O
execution	O
until	O
the	O
procedure	O
call	O
that	O
caused	O
the	O
suspension	O
,	O
and	O
any	O
procedures	O
called	O
in	O
turn	O
by	O
that	O
procedure	O
,	O
have	O
all	O
been	O
fully	O
executed	O
.	O
</s>
<s>
Each	O
processor	O
still	O
has	O
a	O
stack	B-General_Concept
for	O
storing	O
frames	O
whose	O
execution	O
has	O
been	O
suspended	O
;	O
however	O
,	O
these	O
stacks	O
are	O
more	O
like	O
deques	B-Application
,	O
in	O
that	O
suspended	O
states	O
can	O
be	O
removed	O
from	O
either	O
end	O
.	O
</s>
<s>
A	O
processor	O
can	O
still	O
only	O
remove	O
states	O
from	O
its	O
own	O
stack	B-General_Concept
from	O
the	O
same	O
end	O
that	O
it	O
puts	O
them	O
on	O
;	O
however	O
,	O
any	O
processor	O
which	O
is	O
not	O
currently	O
working	O
(	O
having	O
finished	O
its	O
own	O
work	O
,	O
or	O
not	O
yet	O
having	O
been	O
assigned	O
any	O
)	O
will	O
pick	O
another	O
processor	O
at	O
random	O
,	O
through	O
the	O
scheduler	O
,	O
and	O
try	O
to	O
"	O
steal	O
"	O
work	O
from	O
the	O
opposite	O
end	O
of	O
their	O
stack	B-General_Concept
suspended	O
states	O
,	O
which	O
the	O
stealing	O
processor	O
can	O
then	O
begin	O
to	O
execute	O
.	O
</s>
