gen_leader's status.
Alex Arnon
alex.arnon@REDACTED
Wed Aug 16 17:59:40 CEST 2006
Thanks, guys. I didn't even consider using global... it will actually suit
me even better!
On 8/16/06, Ulf Wiger (TN/EAB) <ulf.wiger@REDACTED> wrote:
>
> Scott Lystig Fritchie wrote:
> >
> > (**) I don't know exactly what 'global' does in cases of
> > network partition, but I guess that it will register the
> > global name on each side of the partition. (?)
>
> First of all global will most likely remove any registration
> where the pid is from the node(s) that were lost during
> the network partition. The application may detect the
> nodedown too, and register another pid with global.
>
> When nodes reconnect, global has a default conflict
> resolution method that is pretty draconic: whenever
> two pids are found to be registered with the same
> global name, global picks one pid at random and performs
> exit(P, kill) on it.
>
> When registering a name, one may select another conflict
> resolution method, using
>
> global:register_name(Name, Pid, Method)
>
> The methods provided by global are
> - {global, random_exit_name} which is the default
> - {global, random_notify_name}
> - {global, notify_all_name}
>
> Notes:
>
> - Global performs no check to see whether Method
> actucally succeeded, or whether it is even a
> callable function
> - Global simply does catch Method(Name, Pid1, Pid2)
> which in the default case means
> catch {global, random_exit_name}(Name, P1, P2)
> When providing your own method, it would be
> more stylish to use a fun, I think.
>
> BR,
> Ulf W
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20060816/36633a5e/attachment.htm>
More information about the erlang-questions
mailing list