Intermediate Topic 31 of 51 Concurrency & Parallelism
Task Parallelism
Running different tasks at the same time.
How it works
Task parallelism runs different tasks, possibly with different code, concurrently, such as separate stages of a pipeline, independent function calls or a graph of tasks with dependencies. A scheduler assigns tasks to workers, and frameworks provide task graphs, futures, work-stealing schedulers and dependency tracking, as in Intel TBB, Cilk, Java's ForkJoin and .NET's Task Parallel Library. It suits irregular and heterogeneous workloads.
Where it is used
Compilers running independent passes, game engines running animation, physics and AI systems in parallel, build systems executing independent targets and workflow engines use task parallelism.
Common pitfall
Dependencies between tasks limit parallelism, and tasks that are too fine-grained add scheduling overhead while coarse ones cause imbalance. Shared resources create contention. Deadlocks arise from circular waiting. Work-stealing helps balance load but loses locality. Express dependencies explicitly, tune task granularity and profile to find the critical path.
Where it fits in the course
Task Parallelism is topic 31 of 51 in Concurrency & Parallelism, rated Intermediate. It follows Data Parallelism. The next topic is Fork-Join Model.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Concurrency & Parallelism quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Concurrency & Parallelism quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Task Parallelism?
Where do people use Task Parallelism?
What is the most common mistake with Task Parallelism?
What should I learn before this topic?
How can I practice it?
Is Task Parallelism hard to learn?
How long does it take to learn Task Parallelism?
Which topics are related to Task Parallelism?
What should I study after Task Parallelism?
Related topics
- Data Parallelism (Concurrency & Parallelism)
- Fork-Join Model (Concurrency & Parallelism)
- Software Transactional Memory (Concurrency & Parallelism)
- Parallel Reduction (Concurrency & Parallelism)