Channel-based control-flow for parallel tasks with concurrency control