Cilk has other constructs used for parallelism. One pretty neat thing that I found was the concept of reducers, which can be used instead of locks to deal with data races. They also preserve ordering (for example, when used in a cilk_for).
This comment was marked helpful 0 times.
squidrice
The difference between cilk_sync and barrier is the number of living threads after that point. There is only one thread passing cilk_sync after all the other ones return. While the number of threads keeps the same after barrier.
This comment was marked helpful 0 times.
spilledmilk
One important thing to note for the semantics of cilk_spawn is that it makes no guarantees on when the function will be invoked, just that it will be concurrently invoked sometime in the future. Therefore, cilk_sync is used as a scheduling primitive in this system.
Cilk has other constructs used for parallelism. One pretty neat thing that I found was the concept of reducers, which can be used instead of locks to deal with data races. They also preserve ordering (for example, when used in a cilk_for).
This comment was marked helpful 0 times.
The difference between cilk_sync and barrier is the number of living threads after that point. There is only one thread passing cilk_sync after all the other ones return. While the number of threads keeps the same after barrier.
This comment was marked helpful 0 times.
One important thing to note for the semantics of
cilk_spawn
is that it makes no guarantees on when the function will be invoked, just that it will be concurrently invoked sometime in the future. Therefore,cilk_sync
is used as a scheduling primitive in this system.This is also discussed later on in this slide.
This comment was marked helpful 0 times.