testing codes in erl with running processes

Matthias Lang matthias@REDACTED
Fri Apr 25 06:45:36 CEST 2003

HP Wei writes:
 > I have an erl session, in which there is a process running.
 > I load a testing module which is unrelated to the running process;
 > then, 
 > I type fx(...), without specifying the module name: test:fx(...).
 > erl tells me so dutifully.
 > But after a few seconds, the running process also exits
 > with {badarg...} type of error.
 > Can the action of testing codes somehow
 > interfere with a process running in the background ??

If a process is linked to the shell and the shell exits, then that
process will receive an exit signal. An error in the shell causes the
shell process to exit and restart:

  1> self().
  2> fx().
  ** exited: {undef,[{shell_default,fx,[]},
  3> self().

If you don't want that behaviour, make sure your process isn't linked
to the shell process, for instance by starting it via spawn() instead
of spawn_link().


More information about the erlang-questions mailing list