Spawn process

Mickael Remond <>
Tue Dec 31 15:53:42 CET 2002


* Inswitch Solutions - Erlang Evaluation <> [2002-12-31 10:42:29 -0300]:

> I have spawned a module which doesn't exist and I have received its pid.
> 
> I have done the following from the shell:
> 
> spawn(NotExistModule, start, [Par1]).

Yes, that is the standard behaviour. If you want to be informed of what is
happening on your new process, you need to link your current process to this
new process.
This can be done at "spawn time" by using the function spawn_link.
If you use this function, you get feedback on the runtime error that occurs in
the spawned process. You can thus decide what you want to do.

For example, in the shell:

  3> spawn_link(notExistModule,start,[]).
  <0.232.0>
  ** exited: {undef,[{notExistModule,start,[]}]} **

-- 
Mickaël Rémond



More information about the erlang-questions mailing list