Erlang / Erlang Advanced Interview questions
What is erlang:process_flag(priority,...) used for?
Every Erlang process has a scheduling priority — low, normal (the default),
high, or max — that influences how eagerly the scheduler picks it from the run
queue relative to other ready processes on the same scheduler.
process_flag(priority, high).
Higher-priority processes get scheduled ahead of lower-priority ones when both are runnable, which can help
for genuinely latency-sensitive internal system processes (some parts of the runtime itself use
max). It does not grant more CPU time overall, extra reductions per run, or preempt a currently
running lower-priority process mid-execution — it only affects the order processes are picked from the
queue when the scheduler is choosing what to run next.
More Related questions...