Erlang's Reduction-Based Scheduling Guarantees Fairness
Instead of time-slicing, Erlang's scheduler uses 'reductions' (units of work like function calls) to preempt processes. Each process gets a fixed number of reductions (e.g., 2000) before being swapped out, preventing any single process from monopolizing the CPU and ensuring fair execution and predictable latency.
The top 3
- Erlang's 'Reduction': The Standardized Unit of Work for Fairness: Erlang's scheduler ensures fairness by defining a 'reduction' as its fundamental unit of work, roughly equivalent to a function call or basic operation. Each process is allowed to execute a fixed number of reductions (historically around 1000-2000) before being preempted, guaranteeing that no single process can monopolize the CPU.
- Reductions vs. Time-Slicing: Erlang's Fairness Edge: Erlang's scheduler prioritizes reductions over traditional OS time-slicing for preemption, offering a superior fairness model. Reductions measure actual computational work, providing consistent and predictable CPU allocation, unlike time slices which can vary in actual work performed or be platform-dependent, mitigating performance overheads and enhancing portability.
- Preventing Starvation: Erlang's Guarantee for High Concurrency: Erlang's reduction-based scheduling is vital for preventing process starvation, a common issue in highly concurrent systems. By strictly limiting each process's execution time to a reduction budget, the scheduler ensures that all processes, regardless of their workload or behavior, receive a fair share of CPU time, guaranteeing soft real-time responsiveness and system stability.
Sources
Open the full topic