73
edits
Changes
→Task Parallelism
*The begin statement spawns a thread of execution that is independent of the current (main) thread of execution.
writeln("1: ### The begin statement ###");
*The cobegin statement can be used to spawn a block of tasks, one for each statement.
writeln("2: ### The cobegin statement ###");
cobegin {
writeln("2: output from spawned task 1");
writeln("2: output from spawned task 2");
}
= Reference =