[erlang-questions] JInterface, RPC, self()

Steven Edwards <>
Sat Jan 24 17:36:06 CET 2009


Thanks.  The quick solution is the one I chose: send {ident}, receive {pid,
Pid} for each new Java node.

I know the lists module is implemented in a non-Erlang language (C?) to be
more efficient.  Are global and the other kernel modules implemented in a
similar fashion?

Steven

On Sat, Jan 24, 2009 at 10:46 AM, Robert Virding <> wrote:

> Not directly no. Doing whereis/1 or registered/0 will only work with
> registered names on the same node. An quick solution is to do an rpc to
> other node and do whereis/1 there and send back the pid. If you intend to
> use globally registered names more extensively then I would recommend the
> module 'group'.
>
> Robert
>
> 2009/1/24 Steven Edwards <>
>
> Gotcha.  Is there a BIF that translates the tuple into the pid?
>>
>> Steven
>>
>> On Fri, Jan 23, 2009 at 9:31 PM, Robert Virding <>wrote:
>>
>>> 2009/1/23 Steven Edwards <>
>>>
>>>> `I still heart Erlang, but we're having some trouble communicating.  I'm
>>>> trying to get RPCs to work correctly, but receive {Pid, Result} fails.  I'm
>>>> pretty sure that it fails because I use {mbox, }
>>>> as the initial Pid and JInterface responds with a differently named process
>>>> id.  (Same process, but Erlang's representation.)
>>>
>>>
>>> The simple answer is that {} is not the pid of
>>> a process, it is a tuple which us interpreted as the registered name on
>>> another node. So if the actual pid is returned in the message then it can
>>> never match this (or any) tuple.
>>>
>>> Robert
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20090124/b0941da1/attachment.html>


More information about the erlang-questions mailing list