[erlang-questions] Sending messages to multiple processes?

Robert Virding rvirding@REDACTED
Mon May 4 23:21:12 CEST 2009


No, as there is no basic primitive for sending a message to more than one
process.

Robert

2009/5/1 G.S. <corticalcomputer@REDACTED>

> Is the broadcasting of msgs using pg or pg2 faster than simply having a
> list of pids and looping through them?
>
> 2009/4/30 Davide Marquês <nesrait@REDACTED>
>
> Hi Kevin,
>>
>> Is there a neato idiom for sending a single message to multiple
>>> processes, up to say 200, or do I just need to loop it?
>>
>> No "idiom" that I'm aware of.
>> You can use the pg module to group a bunch of processes together and
>> send them messages via the group name. Info:
>> http://www.erlang.org/doc/man/pg.html
>> http://erlang.org/doc/man/pg2.html
>>
>>  I also need to know they finished processing the message.  Is this the
>>> wrong road to go down?
>>
>> That's just a matter of sending the "master process" Pid to the
>> workers/slaves when they are started and having then report back when
>> they're done.
>>
>>
>>> Basically I'm starting 200 processes, reading in a single file, and each
>>> process is fed the same line of the file one by one until the end, but
>>> they all handle it differently, and when they have finished all the
>>> lines, they spit out a modified file, and return a value to indicate
>>> they are finished.
>>
>>
>> For this simple case you can stick to your own master/slave processes. :)
>>
>>
>>> Thanks for any advice,
>>> Kevin
>>> _______________________________________________
>>> erlang-questions mailing list
>>> erlang-questions@REDACTED
>>> http://www.erlang.org/mailman/listinfo/erlang-questions
>>>
>>
>>
>>
>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://www.erlang.org/mailman/listinfo/erlang-questions
>>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20090504/4916d300/attachment.htm>


More information about the erlang-questions mailing list