Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I change the priority of a process in Erlang?

I understand from here http://cs.ucsb.edu/~puneet/reports/erlang.pdf (section 4.4) that Process Scheduling in Erlang is based on 4 different queues - with one designated as 'highest priority'. I have an Erlang program and I'd like to assign one process so that its instructions join this queue. Is there a way to do this? Are there any watch-its when doing this?

like image 444
atomh33ls Avatar asked Nov 14 '12 11:11

atomh33ls


1 Answers

Check Erlang's doc here. There is a BIF called process_flag(Flag, Option).

process_flag(priority, Level)
% This sets the process priority. Level is an atom. 
% There are currently four priority levels: low, normal, high, and max. 
% The default is normal.
like image 120
halfelf Avatar answered Oct 16 '22 15:10

halfelf