I have a question on the number of cilk_spawn keywords in a code block. Originally I used only one cilk_spawn as in code 1, but in myspecificexperiment, code 2 appears to be faster than code 1.
// code 1
cilk_spawn f1();
f2();
f3();
cilk_sync;
// code 2
cilk_spawn f1();
cilk_spawn f2();
cilk_spawn f3();
cilk_sync;
Is code 2 even the right way to use cilk_spawn? Could anyone please comment on the run time difference between one and multille usage of cilk_spawn?
Thank you very much in advance.
Regards,
Hailong


