[eeps] Per-module process registration
Richard O'Keefe
ok@REDACTED
Wed Feb 10 02:22:37 CET 2010
On Feb 9, 2010, at 11:23 PM, Håkan Mattsson wrote:
> On Tue, Feb 9, 2010 at 5:49 AM, Richard O'Keefe <ok@REDACTED>
> wrote:
>
>> A proposal for per-module registries with atomic registration.
>
> Is this really needed? If you let the newly spawned process register
> its own name, you don't get the race condition. Processes that fails
> to register its own name will simply crash.
There are several issues, not all of them explained in the EEP.
*ONE* is the race issue. A newly spawned process doesn't *have*
a name, I presume you mean its pid. If someone can explain to
me _how_ having a process register itself makes the totality of
start/Whatever easier to get right than the spawn_if_necessary/2
I described, I would be grateful.
Perhaps the *major* issue is the total lack of encapsulation.
The registry is, by design and intent, *global*. Every registered
process is visible, not merely within its node, but to every
process in every node in a connected set of nodes.
There are times when you want that, but the vast majority of cases
in the Erlang/OTP sources that I checked used the global registry
but were constructed as if the process were private.
More information about the eeps
mailing list