Function concore::v1::spawn_and_wait(std::initializer_list<task_function>&&, bool)

Function Documentation

void concore::v1::spawn_and_wait(std::initializer_list<task_function> &&ftors, bool wake_workers = true)

Spawn multiple tasks and wait for them to complete.

This is used when a task needs multiple things done in parallel.

Parameters
  • ftors: A list of functors to be executed

  • wake_workers: True if we should wake other workers for the last task

This function is similar to the spawn() functions, but, after spawning, also waits for the spawned tasks to complete. This wait is an active-wait, as it tries to execute other tasks. In principle, the current thread executes the last of the spawned tasks.

This will create a new task group, inheriting from the task group of the currently executing task and add the new tasks in this new group. The waiting is done on this new group.