[erlang-questions] end of process

Robert Virding <>
Sat Nov 20 01:52:02 CET 2010


Whether calling exit/1 results in a normal or abnormal process termination depends solely on the exit value. Calling exit(normal) results in a normal termination and is exactly equivalent to the spawned function running to its end. The return value from the spawned function is completely ignored and is lost. A process does not "return a value" and if you want to get some value from it you need to send it in a message.* Calling exit/1 with any other value results in an abnormal process termination which is equivalent to an exception occurring in the process. The exit value is not returned anywhere but passed as an exit signal to processes which are linked to the exiting process.

Robert

* Or by cunning use of exit values and signals. :-)

----- "info" <> wrote:

> Thank you Ivan for this explanation.
> If I resume: exit for abnormal end and ok or nothing for normal end.
> trap to the parent level.
> 
> J-Ph. Constantin
> ITS3 Genève
> www.its3.ch

-- 
Robert Virding, Erlang Solutions Ltd.


More information about the erlang-questions mailing list