如何确定Erlang进程(PID)在哪个节点上运行? [英] How do I found out which node an Erlang process (PID) is running on?

查看:80
本文介绍了如何确定Erlang进程(PID)在哪个节点上运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

鉴于我可以将一个进程的PID发送到另一个节点,甚至可以跨节点发送,如果我从另一个进程(可能在另一个节点上)中的一个进程收到一个PID,我怎么找出有问题的PID在哪个节点上在/上运行?

Given that I can send PIDs from a process to an other, even across nodes, if I receive a Pid from a process within a different process (possibly on a different node) how do I find out which node the PID in question runs in/on?

erlang:process_info(Pid)似乎没有该信息.

谢谢.

推荐答案

erlang:node/1

node(Arg)->节点

node(Arg) -> Node

返回Arg所在的节点.Arg可以是pid,引用或端口.如果本地节点不活跃,则返回nonode @ nohost.

Returns the node where Arg is located. Arg can be a pid, a reference, or a port. If the local node is not alive, nonode@nohost is returned.

这篇关于如何确定Erlang进程(PID)在哪个节点上运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆