4 ms·
The OP mentions spawn/sync, so I looked it up, here's a snippet from Cilk's wikipedia page [1]: 01 cilk int fib (int n) 02 { 03 if (n < 2) return n;
by Maro 15y ago
The OP mentions spawn/sync, so I looked it up, here's a snippet from Cilk's wikipedia page [1]:
01 cilk int fib (int n)
02 {
03 if (n < 2) return n;
04 else
05 {
06 int x, y;
07
08 x = spawn fib (n-1);
09 y = spawn fib (n-2);
10
11 sync;
12
13 return (x+y);
14 }
15 }
[1] http://en.wikipedia.org/wiki/Cilk http://en.wikipedia.org/wiki/Cilk