【问题标题】:How to get the process ID of the current process in Erlang shell?如何在 Erlang shell 中获取当前进程的进程 ID?
【发布时间】:2016-09-14 17:09:21
【问题描述】:

在Erlang中访问shell时如何获取当前运行进程的进程ID

【问题讨论】:

    标签: erlang erlang-shell


    【解决方案1】:

    流程 - 并发的基本单位 - 产卵便宜 - 拥有自己的堆栈和堆 - 不与其他进程共享内存 - 通信是通过异步消息传递完成的。 - 示例:

    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
    

    【讨论】:

      猜你喜欢
      • 2010-11-19
      • 2010-12-25
      • 2013-06-24
      • 2013-11-12
      • 1970-01-01
      • 2010-10-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多