6
我從這裏瞭解到http://cs.ucsb.edu/~puneet/reports/erlang.pdf(第4.4節)Erlang中的進程調度基於4個不同的隊列 - 一個被指定爲「最高優先級」。我有一個Erlang程序,我想分配一個進程,以便它的指令加入這個隊列。有沒有辦法做到這一點?在做這件事時是否有任何手錶?我可以更改Erlang中進程的優先級嗎?
我從這裏瞭解到http://cs.ucsb.edu/~puneet/reports/erlang.pdf(第4.4節)Erlang中的進程調度基於4個不同的隊列 - 一個被指定爲「最高優先級」。我有一個Erlang程序,我想分配一個進程,以便它的指令加入這個隊列。有沒有辦法做到這一點?在做這件事時是否有任何手錶?我可以更改Erlang中進程的優先級嗎?
查看Erlang的文檔here。有一個名爲process_flag(Flag, Option)
的BIF。
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.
謝謝。我猜你在產卵之前就使用了這個函數?或者你把它放在你產卵的功能中? – atomh33ls
@ atomh33ls看到[這個問題](http://stackoverflow.com/questions/13381036/what-is-the-correct-use-of-process-flagpriority-level-in-erlang)。如果你想改變外部的優先級,那麼會有process_flag/3 – halfelf