【发布时间】:2016-09-14 17:09:21
【问题描述】:
在Erlang中访问shell时如何获取当前运行进程的进程ID。
【问题讨论】:
标签: erlang erlang-shell
在Erlang中访问shell时如何获取当前运行进程的进程ID。
【问题讨论】:
标签: erlang erlang-shell
流程 - 并发的基本单位 - 产卵便宜 - 拥有自己的堆栈和堆 - 不与其他进程共享内存 - 通信是通过异步消息传递完成的。 - 示例:
Erlang shell 访问
> self().
<0.720.0> -- Process id
> self() ! {hello, world}, ok.
ok
> self() ! {hello, world}, ok.
ok
> flush(). // Prints what you had done in the session
Shell got {hello, world}
Shell got {hello, world}
ok
【讨论】: