Erlang's 'Reduction' Scheduling: Fairer Than Time-Slicing
Erlang's BEAM VM uses 'reductions'—units of work like function calls—to preempt processes instead of fixed time slices. This ensures fair CPU allocation, preventing any single process from monopolizing resources and mitigating starvation, even with millions of concurrent processes.
The top 3
- Reductions: BEAM's Workload-Based Fairness Metric: Erlang's scheduler defines a 'reduction' as a unit of work (e.g., function call, message passing), preempting processes after a set number (e.g., 2000) to guarantee fair CPU time distribution.
- Why Erlang Avoids OS Time-Slicing for Preemption: Unlike traditional OS time-slicing, Erlang's reduction-based preemption prevents CPU monopolization by long-running processes or infinite loops, ensuring responsiveness crucial for soft real-time systems.
- Process Starvation Guard: Reductions Ensure Fair CPU Access: Erlang's reduction-based scheduling prevents any single process from indefinitely monopolizing the CPU, ensuring fair access and mitigating process starvation even among millions of concurrent lightweight processes.
Sources
Open the full topic