[Erlang]link Process Signal explanation

Source: Internet
Author: User
Tags terminates

original articles, reproduced please specify the Source: Server non-amateur research http://blog.csdn.net/erlib author Sunface Contact e-mail: [Email protected]
It is estimated that many students will be a little confused about the various signals and capturing mechanism of link, I am drawing a form here, I share it to everyone
reason trapping exits (trap_exit = True ) not trapping exits (trap_exit = False )
normal Receives{‘EXIT‘, Pid, Normal} Nothing happens
kill terminates with Reason killed terminates with Reason killed
other receives {' EXIT ', Pid, other} Terminates with reasonOther

If there is a A, a, two process and link to each other1. When the end of A is normal (the process is normal), B will not exit, at this time the link mechanism does not take effect2. If the end of a is killed, such as Call Exit (Pida,kill), the exit signal capture mechanism is not valid, regardless of whether B has a set trap_exit,b terminate.3. If the end of a is not normal or killed (for example, Exit Pida,reason), then B will capture the exit signal when the trap_exit is set, instead of receiving a message {' EXIT ', Pid,reason}, at which time B does not end, the user can process the end of a process according to the message received, if B is not set TRAP_EXIT,B will terminate
I hope that we can clarify these relationships, and that these relationships are very important in building systems ., I hope everyone can design a clear and well-coupled structure

[Erlang]link Process Signal explanation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.