Home Knowledge Base Task Parallelism and Work-Stealing Schedulers

Task Parallelism and Work-Stealing Schedulers are the parallel programming model and runtime system where computation is decomposed into discrete tasks (units of work) that are dynamically scheduled across available processor cores — using work-stealing to automatically balance load by allowing idle cores to "steal" tasks from busy cores' queues, achieving near-optimal load balance without programmer intervention.

Task vs. Data Parallelism

Data parallelism applies the same operation to different data (SIMD, GPU kernels). Task parallelism applies different operations to potentially different data — a producer-consumer pipeline, recursive divide-and-conquer, or independent computations with complex dependencies. Task parallelism is essential for irregular workloads where data parallelism alone cannot extract all available concurrency.

The Fork-Join Model

The dominant task-parallel abstraction: 1. Fork: A task spawns child tasks that can execute in parallel. 2. Compute: Parent and children execute concurrently on different cores. 3. Join (Sync): The parent waits for all children to complete before proceeding.

Recursive algorithms (merge sort, tree traversal, graph search) naturally map to fork-join: each recursive call becomes a spawned task.

Work-Stealing Scheduler

Theoretical Guarantees

Cilk's work-stealing scheduler provides a provable bound: for a computation with T₁ total work and T∞ critical path length (span), execution on P processors completes in expected time T₁/P + O(T∞). This is within a constant factor of optimal for any scheduler. The number of steal operations is O(P × T∞), meaning communication is proportional to the span, not the total work.

Implementations

Task Parallelism with Work-Stealing is the dynamic, adaptive approach to parallel execution — letting the runtime discover and exploit parallelism that the programmer expresses structurally, without requiring the programmer to manually partition work across cores or predict load imbalance.

task parallelism modelfork join frameworkwork stealing schedulertask graph executioncilk spawn sync

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.