Killing spawned functions

Killing spawned functions

Is it possible for a parent function to kill or cancel all its spawned functions?

publicaciones de 2 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

This is speculative computing. Cilk++ doesn't have builtin support for speculation because it is non-deterministic. I.e., it makes it difficult to reason about the correctness of code. Thus, Cilkscreen would not necessarily report races when they exist, and Cilkview's output would be irrelevant.

You can, however, implement speculation, yourself, if you don't mind the above limitations. E.g.,

void bar (volatile int *abort_parallelism) {
while (!*abort_parallelism) {
if (do_work() == meets_some_aborting_condition) *abort_parallelism = 1;

void foo () {
volatile int abort_parallelism = 0;
cilk_spawn bar(&abort_parallelism);

Deje un comentario

Por favor inicie sesión para agregar un comentario. ¿No es socio? Únase ya