[erlang-questions] Erlang's process not killed by exit signalreasoned by "kill"
Robert Virding
rvirding@REDACTED
Thu Oct 29 14:36:37 CET 2009
2009/10/28 Joe Armstrong <erlang@REDACTED>
>
> ---- a different way of describing the same thing
>
> The VM behaves as if there were 3 type of inter-process messages:
>
> (1, Data) tuples represent regular messages
> (2, Data) tuples represent signals
> 3 is the kill signal
>
> P ! X sends a type 1 message (1,X)
> exit(X) sends a type 2 message (2,X)
> exit(P, kill) sends a type 3 message
> exit(P, X) sends a type 2 message (2,X)
>
> on receiving a type 2 message if X != normal a normal process dies
> on receiving a type 2 message a system process converts this to a (1,X)
> message
> on receiving a type 3 message the receiving process dies unconditionally
>
> --- end
>
Yes, this is clear and understandable. In these terms I suppose you could
describe the problem as:
When I do exit(Self, kill) it sends a type 3 'kill' signal to myself and
when I die I send type 2 'killed' signals to my linked processes. This is
consistent irrespective to whom I send the kill signal.
BUT when I do exit(kill) I send a type 2 signal with value 'kill' which
doesn't behave as a type 3 'kill' signal though the name is the same. This
is inconsistent, and I don't like inconsistencies. There are two different
solutions: either send out real type 3 kill signals; or send out type 2
'killed' signals as if I had received a type 3 signal. Both are consistent,
but which is best?
This is how I have read the problem.
Robert
More information about the erlang-questions
mailing list