[erlang-patches] Re: gen:call({global, Name}, ...)

Hans Bolinder hans.bolinder@REDACTED
Thu Nov 17 14:49:54 CET 2011


Hi,

[Geoff Cant:]
> Henrik Nord <henrik@REDACTED> writes:
> 
> > On 03/31/2011 12:28 PM, Henrik Nord wrote:
> >> On 03/30/2011 03:19 AM, Geoff Cant wrote:
> >>> Hi all, I discovered today that gen:call({global, Name}, Label, Request,
> >>> Timeout) calls global:safe_whereis_name(Name) to determine the Pid to
> >>> look up globally registered names.
> >>>
> >>> global:safe_whereis_name/1 doesn't seem to offer any particular safety
> >>> and more importantly, serializes all global name lookups on a
> >>> node. (Using
> >>> global:whereis_name/1 instead is just an ets lookup).
> >>>
> >>> Can we safely make a change like
> >>> https://github.com/archaelus/otp/commit/4f6e8a147b3c600eef2dd05f8ce0d51cf9c35383 
> >>>
> >>> in gen.erl and improve call time and reduce the load on
> >>> global_name_server at a stroke?
> >
> > This has apparently been tested before, and found to be unsafe.
> > So im pulling it out.
> 
> Hi Henrik, thanks for looking at this patch.
> 
> Is there an important edge case I'm missing here?

Sorry about the late answer.

A bug affecting supervisor:start/6 was masked out by the call to
global:safe_whereis_name().

The bug has been fixed now, and we've removed all calls to
global:safe_whereis_name() in the upcoming release.

Best regards,

Hans Bolinder, Erlang/OTP team, Ericsson



More information about the erlang-patches mailing list