[erlang-questions] Teaching Erlang as part of a paper -- advice sought
Ulf Wiger
ulf.wiger@REDACTED
Wed Feb 10 08:52:07 CET 2010
Richard O'Keefe wrote:
>
> What am I missing? How does only allowing a process to register
> itself eliminate the race? The race is a race for access to the
> registry entry.
There is another race, and that is covered in the PULSE
paper. Basically, you cannot implement a process registry
in Erlang that has well-defined semantics when more than
two processes are involved in the race (or at least that's
what it looks like; the paper only covers the two-process
case, and discusses some obvious problems if a third process
would be involved.
The seemingly unsolvable problem is when processes content
for a registered name and one or more of them start
crashing in the middle of the race. The semantics /as given
by the existing registration bifs/ requires the ability
to handle process EXITs and the registry within the same
critical section, something that cannot be done in Erlang
code. So the semantics should change somehow, if nothing
else because maintaining a large critical section when
extending into many-core is not a good idea.
The way to avoid the simple race is to start the process
synchronously, e.g. using proc_lib:start_link(...). C.f.
gen_server:start_link({local,Name},...).
BR,
Ulf W
--
Ulf Wiger
CTO, Erlang Solutions Ltd, formerly Erlang Training & Consulting Ltd
http://www.erlang-solutions.com
---------------------------------------------------
---------------------------------------------------
WE'VE CHANGED NAMES!
Since January 1st 2010 Erlang Training and Consulting Ltd. has become ERLANG SOLUTIONS LTD.
www.erlang-solutions.com
More information about the erlang-questions
mailing list