September 2013
Intermediate to advanced
548 pages
12h 25m
English
The primitives for manipulating links and monitors and for trapping and sending exit signals are as follows:
-spec spawn_link(Fun) -> Pid-spec spawn_link(Mod, Func, Args) -> Pid
This behaves like spawn(Fun) or
spawn(Mod,Func,Args) and also creates a link
between the parent and child processes.
-spec spawn_monitor(Fun) -> {Pid, Ref}-spec spawn_monitor(Mod, Func, Args) -> {Pid, Ref}
This is like spawn_link, but it creates a monitor rather than a link.
Pid is the process identifier of the newly created process, and
Ref is a reference to the monitor. If the process dies with the reason
Why, then the message {’DOWN’,Ref,process,Pid,Why}
will be sent to the parent process.
-spec process_flag(trap_exit, true)This turns ...
Read now
Unlock full access