|
Re: testing codes in erl with running processes: msg#00380lang.erlang.general
>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(). > <0.25.0> > 2> fx(). > ** exited: {undef,[{shell_default,fx,[]}, > 3> self(). > <0.40.0> > >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(). I checked my code for that process at issue. It uses spawn(Mod, loop, [Tab]). In the loop(), there is a receive stop -> stop after 30000 -> loop(Tab) end. I use your simple test: self(). and fx(). ---------> the shell exited as you described. And after a few moment, that process also died !! Any idea whether there is bug somewhere ?? --HP |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Erlang in a french magazine (L'informaticien): 00380, Mickael Remond |
|---|---|
| Next by Date: | Re: testing codes in erl with running processes: 00380, HP Wei |
| Previous by Thread: | Re: testing codes in erl with running processesi: 00380, Matthias Lang |
| Next by Thread: | Re: testing codes in erl with running processes: 00380, HP Wei |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |