开发者

multi-threaded signal handling

  1. In unix, If a multi-threaded process was sent a signal, which thread will be the one to execute the handling function?

  2. if it is a multi-cpu machine, more than 1 thread is running at the sa开发者_高级运维me time. which thread will be the on to run the signal handling function?


According to man 7 signal, all threads in the process share the same signal handler, and if a signal is delivered to a process with multiple threads that have not blocked the signal, one of them is arbitrarily chosen to receive it.

Having a multi-CPU machine will not change these semantics.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜