Is the broadcasting of msgs using pg or pg2 faster than simply having a list of pids and looping through them? <br><br><div class="gmail_quote">2009/4/30 Davide Marquês <span dir="ltr"><<a href="mailto:nesrait@gmail.com">nesrait@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Kevin,<br><br><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Is there a neato idiom for sending a single message to multiple<br>
processes, up to say 200, or do I just need to loop it?</blockquote></div><div>No "idiom" that I'm aware of.<br>You can use the pg module to group a bunch of processes together and<br>send them messages via the group name. Info:<br>

<a href="http://www.erlang.org/doc/man/pg.html" target="_blank">http://www.erlang.org/doc/man/pg.html</a><br><a href="http://erlang.org/doc/man/pg2.html" target="_blank">http://erlang.org/doc/man/pg2.html</a><br><br></div>
<div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

I also need to know they finished processing the message.  Is this the<br>
wrong road to go down?</blockquote></div><div>That's just a matter of sending the "master process" Pid to the<br>workers/slaves when they are started and having then report back when<br>they're done.<br>
 </div><div class="im">
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Basically I'm starting 200 processes, reading in a single file, and each<br>
process is fed the same line of the file one by one until the end, but<br>
they all handle it differently, and when they have finished all the<br>
lines, they spit out a modified file, and return a value to indicate<br>
they are finished.</blockquote></div><div><br>For this simple case you can stick to your own master/slave processes. :)<br> <br></div><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">



Thanks for any advice,<br>
<font color="#888888">Kevin<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://www.erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://www.erlang.org/mailman/listinfo/erlang-questions</a><br>
</font></blockquote><br><br></div></div><br>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://www.erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://www.erlang.org/mailman/listinfo/erlang-questions</a><br></blockquote></div><br>