Title here
Summary here
Here’s the explanation and translated code in Chapel following the structure and details provided in the example.
A task is a lightweight thread of execution.
Suppose we have a function call f(s)
. Here’s how we’d call that in the usual way, running it synchronously.
When we run this program, we see the output of the blocking call first, then the output of the two tasks. The tasks’ output may be interleaved because tasks are being run concurrently by the Chapel runtime.
Next, we’ll look at a complement to tasks in concurrent Chapel programs: channels.