Skip to content

Commit

Permalink
Update Tutorials “introduction-to-cilk-programming”
Browse files Browse the repository at this point in the history
  • Loading branch information
ailiop committed Jul 28, 2022
1 parent 6d2ae1b commit 5ac7a08
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/doc/tutorials/introduction-to-cilk-programming.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ int p_fib(int n)
{
if (n < 2) return n;
else {
int x = cilk_spawn p_fib(n-1); // don't wait for funtion to return
int y = p_fib(n-2); // in parallel with spawned function
cilk_sync; // wait for spawned function to finish
cilk_scope {
int x = cilk_spawn p_fib(n-1); // don't wait for funtion to return
int y = p_fib(n-2); // in parallel with spawned function
} // wait for spawned function to finish
return x + y;
}
}
Expand Down

0 comments on commit 5ac7a08

Please sign in to comment.