这是代码:
Erlang/OTP 20 [erts-9.1] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:10] [kernel-poll:false]
Eshell V9.1 (abort with ^G)
1> process_flag(trap_exit, true).
false
2> spawn_link(fun() -> exit(reason) end).
<0.63.0>
3> receive X -> X after 0 -> 'end' end.
{'EXIT',<0.63.0>,reason}
4> spawn_link(fun() -> exit(reason) end).
<0.66.0>
5> receive X -> X after 0 -> 'end' end.
'end'
Run Code Online (Sandbox Code Playgroud)
为什么erlang shell不会从第二个生成的进程接收退出消息?
是什么之间的差异simple_one_for_one,并one_for_one重启策略?什么时候需要更喜欢一个?