Previous | Next --- Slide 8 of 45
Back to Lecture Thumbnails
kayvonf

This is another abstraction vs. implementation scenario. It might seem trivial, but I'd like to see someone try and restate the point of this slide in their own words. Can you write down the semantics of the cilk_spawn construct clearly?

mingf

The semantics of cilk_spawn is to specify an independent invocation that potentially runs asynchronously with other calls and must complete before corresponding cilk_sync.

afa4

cilk_spawn semantics specify independent work. This work is executed in a "logical" thread of control and it may or may not be executed in parallel with the caller or other spawned work. The semantics do not specify how or when the spawned work is scheduled to execute.

scedarbaum

Of interesting note, though we talk mostly about cilk_spawn/cilk_sync in this lecture, Cilk also has a very abstract/declarative cilk_for intrinsic. This is very analogous to OpenMP's parallel for in that it implicitly states that loop iterations are independent.

kayvonf

Which is implemented under-the-hood in the divide-and-conquer manner described on slide 27.

landuo

The semantics of cilk_spawn is to spawn an independent function call that may or may not executes concurrently with the caller. This is an example of abstraction because the programmer does not need to concern about actual implementation details of cilk_spawn (i.e. whether it is implemented by SIMD instructions or handled by worker thread pool etc.)