Dec 19, 2007
Generic-user-small Jahyun Oh 1 post

Topic: Programming Erlang / Question about an untrappable exit signal

Hello.

I have a question about an untrappable exit signal.

On the page 163 of Programming Erlang, the book describes :

If the reason is given as kill, then an untrappable exit signal will be sent. An untrappable exit signal will always kill the process it is sent to, even if it is a system process.

I read it and thought that the exit signal by the exit reason ‘kill’ is never trapped.

I wanted to test this work between the processes. So, I made a link between a normal process ‘A’ and a system process ‘B’.

And I got two results in the test :
  • When ‘A’ called exit(kill), ‘B’ trapped the exit signal.
  • When ‘A’ called exit(B, kill), ‘B’ dead.

edemo1 and edemo2 that were demo programs of “Trapping Exit signals (Advaned)” of the Programming Erlang showed the same results, but the explaination about the result of demo programs wasn’t detailed.

Why was the exit signal by calling exit(kill) trapped?
(Is there some differences between exit/1 and exit/2?)

/jahyun

1 post