我想使用process_flag(priority,Level)来设置进程的优先级.我有点困惑的是它应该放在我的代码中,似乎无法找到一个例子.
我能看到的两个选项是:
(1)在产生进程之前设置标志:
process_flag(priority, max),
register(myprocess, spawn(fun() -> myprocess() end)),
Run Code Online (Sandbox Code Playgroud)
(2)在生成函数后设置函数内的标志:
myprocess() ->
process_flag(priority, max),
%do stuff
Run Code Online (Sandbox Code Playgroud)
此外,如果选项1是正确的,我是否需要normal在生成其他进程之前将标志重置为?