Skip to content

do parallel tasks

cl4cnam edited this page Dec 5, 2023 · 1 revision

General case

Just code:

parallel ||
	yourFirstTask
	...
||
	yourSecondTask
	...
||
	...
||
	yourLastTask
	...

Note

This is called a "parallel construct". This construct terminates only when all your tasks are finished. So, following instructions are executed only then.

If you want to terminate the parallel construct earlier

If you want to terminate the parallel construct as soon as the Nth task is terminated

code:

parallel exitWith branch N ||
	yourFirstTask
	...
||
	yourSecondTask
	...
||
	...
||
	yourLastTask
	...

Note

When the Nth task is terminated, all the other tasks are discontinued.

If you want to terminate the parallel construct as soon as N tasks are terminated

code:

parallel exitAfter N finished ||
	yourFirstTask
	...
||
	yourSecondTask
	...
||
	...
||
	yourLastTask
	...

Note

When N tasks are terminated, all the other tasks are discontinued.

Clone this wiki locally