9 Scheduling

SCHEDULINGREVIEWED: 2026-09-13

A scheduler decides which task runs on which thread. In parallel R that decision shows up as wall time: a worker that has run out of tasks while another still has a long queue is a core paid for and not used. The two pages here cover how a scheduler moves work to idle workers, and how the size of each task limits what it can do.

After this section

  • Describe work stealing and explain why it reduces load imbalance
  • Explain why the owner of a deque and its thieves work at opposite ends
  • Choose a chunk size that balances per-task overhead against load balance
  • Tell when the scheduler matters for an R workload and when the task size does

The pages

  1. Work Stealing. A scheduling algorithm that keeps all threads busy without central coordination.
  2. Task Granularity and Load Balancing. Trading overhead against load balance through chunk size and dynamic scheduling.

Before this section

Read Concurrency and Parallelism first.

Where this leads

Serialization covers what it costs to move a task’s data to another worker. My threaded-r and sunlight projects both depend on efficient scheduling.

Thread Pools explains the structure of worker pools as a scheduling substrate. Nested Parallelism covers oversubscription and when adding more parallelism helps.

This section covers work distribution algorithms and their tradeoffs. Tasks versus threads, global versus per-worker queues and backpressure are on the Thread Pools page. Cancellation, priorities, affinity and NUMA placement are not covered.

Back to top