start_link and death of parent

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

start_link and death of parent

Fredrik Linder-2
Ahh, {'EXIT', Pid, 'normal'} never kills a process... So, please ignore the previous message.

/Fredrik

> -----Original Message-----
> From: owner-erlang-questions
> [mailto:owner-erlang-questions]On Behalf Of Fredrik Linder
> Sent: den 17 juni 2004 17:53
> To: erlang-questions
> Subject: start_link and death of parent
>
>
> Hello OTP Folks
>
> I get this very strange behaviour from otp-r9c-0 built on
> redhat-8 or redhat-9 (not 100% sure which).
>
> Is this a known problem in r9c-0, and if so is it corrected in r9c-1?
>
> (traffic)265> whereis(d).
> undefined
> (traffic)266> l(d).
> {module,d}
> (traffic)267> P=spawn(fun()->io:format("result:
> ~w~n", [catch d:start_link()]) end).
> <1308.2281.0>
> result: {ok,<1308.2282.0>}
> (traffic)268> erlang:is_process_alive(P).
> false
> (traffic)269> whereis(d).
> <1308.2282.0>
> (traffic)270> erlang:is_process_alive(whereis(d)).
> true
> (traffic)271> exit(whereis(d),kill).
> true
> (traffic)272> whereis(d).
> undefined
> (traffic)273>
>
> Shouldn't <1308.2282.0> die when <1308.2281.0> dies.
>
> The 'd' module is just the emacs skeleton for gen_server in
> of r9c-0 with -define(SERVER, ?MODULE).
>
> /Fredrik
>