[erlang-questions] best way to implement a "barrier"

Richard Carlsson richardc@REDACTED
Wed Oct 1 14:58:39 CEST 2008


Joel Reymont wrote:
> 
> On Oct 1, 2008, at 11:38 AM, Richard Carlsson wrote:
> 
>> How exact do you need the synchronization to be? The simplest barrier
>> is a receive that waits for a start message
> 
> That's what I was thinking. The question then is how to ensure that all
> processes get the start message more or less at the same time. I guess
> this is the question of how long it takes to send 10k-50k start messages.

A quick experiment from the command line: 200 ms for 50000 messages (not
including the time to traverse the list), on the local machine. Fast
enough? For a bunch of connected nodes, I'd avoid sending 50000 separate
messages - if possible, send 1 message to each node, telling it to
broadcast to only its local processes.

    /Richard



More information about the erlang-questions mailing list