- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试配置,什么是组长以及它与 I/O 模块的关系,但在互联网上找不到任何有用的东西。可以请人解释一下吗?
我有以下来自 elixir 1.2 book(Dave Thomas) 的场景:
在第二个窗口,他为什么通过:erlang_group_leader
?它有什么用?
最佳答案
group_leader() -> pid()
Returns the process identifier of the group leader for the process evaluating the function.
Every process is a member of some process group and all groups have a group leader. All I/O from the group is channeled to the group leader. When a new process is spawned, it gets the same group leader as the spawning process. Initially, at system start-up, init is both its own group leader and the group leader of all processes.
group_leader(GroupLeader, Pid) -> true
Types:
GroupLeader = Pid = pid()
Sets the group leader of Pid to GroupLeader. Typically, this is used when a process started from a certain shell is to have another group leader than init.
See also group_leader/0.
By modelling IO devices with processes, the Erlang VM allows different nodes in the same network to exchange file processes in order to read/write files in between nodes. Of all IO devices, there is one that is special to each process: the group leader.
The group leader can be configured per process and is used in different situations. For example, when executing code in a remote terminal, it guarantees messages in a remote node are redirected and printed in the terminal that triggered the request.
关于elixir - 什么是组长,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36318766/
我是一名优秀的程序员,十分优秀!