[erlang-questions] How to send a message to all nodes without UDP broadcast?

Johan Montelius <>
Thu Mar 18 09:30:30 CET 2010


A word of warning and: rpc:abcast/1 is not atomic multicast as abcast  
normally refers to. It implements a basic multicast. If the sender dies  
you might have a situation where only some of the processes have received  
the message. This also goes for the list comprehension solution and also  
for how the pg module is implemented. The pg modules does however give you  
a total order of message delivery something that rpc:abcast does not.

   Johan



On Wed, 17 Mar 2010 23:10:07 +0100, Håkan Mattsson <>  
wrote:

> Yet another alternative:
>
>   rpc:abcast(foo, Msg).
>
> /Håkan
>
> 2010/3/17 Ulf Wiger <>:
>>
>> If you want to include the node you're on:
>>
>> [{foo,X} ! Msg || X <- [node()|nodes()]].
>>
>> BR,
>> Ulf W
>>
>> On Wed, 17 Mar 2010 18:48:33 +0100, Hynek Vychodil <>
>> wrote:
>>
>>> [{foo,X} ! Msg || X<- nodes()].
>>>
>>> On Tue, Mar 9, 2010 at 12:31 AM, 钱晓明 <> wrote:
>>>>
>>>> Hi, this may be a simple question, but I am newer and did not find the
>>>> answer in book. I want to send a message to all nodes(using same  
>>>> cookie)
>>>> in
>>>> one call, but not using the UDP broadcast. How can I do this ? Can
>>>> someone
>>>> take one minute to answer me ? thanks!
>
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:
>


-- 
Dr Johan Montelius
Royal Institute of Technology - KTH
School of Information and Communication Technology - ICT


More information about the erlang-questions mailing list