Erlang/OTP Forums

Author Message

<  Open Telecom Platform (OTP)  ~  node index in process pid

michal
Posted: Wed Aug 23, 2006 12:42 pm Reply with quote
User Joined: 20 Jul 2006 Posts: 44 Location: London
Hi,
I have two erlang nodes running in distributed mode. Executing self() in the shell of one of these nodes will return a "local" pid of a process like: <0.36.0>. The first digit indicates the "node index". If the pid would be sent to the process running on the other node, it will be translated to something like <4831.36.0>. Is there any simple way to get the "node index" of the other node without sending any messages between nodes?

Michal
View user's profile Send private message
michal
Posted: Wed Aug 23, 2006 3:28 pm Reply with quote
User Joined: 20 Jul 2006 Posts: 44 Location: London
I realised that if you spawn a process on a remote node, you get the pid of the new process...so for debugging (and this is my case) I can execute:

Code:
(node1@somehost)1> spawn(node2@somehost, fun() -> ok end).
<4811.41.0>
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum