Public PID?

Vlad Dumitrescu vlad_dumitrescu@REDACTED
Thu May 4 15:45:37 CEST 2006


Hi,


  _____  

From: owner-erlang-questions@REDACTED
[mailto:owner-erlang-questions@REDACTED] On Behalf Of Eric Shun


I'd like to send a message to a process on another node. As I don't want to
register the pid, I can't use 
{Node,Pid} ! Message.
So I can I know the "public" pid of a process (eg: <5533,245,0>) , as self()
only returns a "private" pid (eg: <0,245,0>)? 
So I could do:
PublicPid ! Message.

 

There is no public pid for a process. 
 
What you can do is send the pid through a message, and then the receiver
will be able to use it. Receivers on different runtimes will see
different-looking pids.
 
Of course, you have then a chicken-and-egg problem: if the client wants to
get the pid, who does it ask? It can't ask the process itself, because it
doesn't know its pid. It has to be able to access some process by name, and
from there retrieve the required pid; alternatively, reconsider registering
the process.
 
Why do you need to remotely access an unregistered process? 
 
best regards,
Vlad
 
 
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20060504/c23b646b/attachment.htm>


More information about the erlang-questions mailing list