开发者

Signal Dispositions in Pthreads

The man page for pthreads mentions:

 POSIX.1 also requires that thre开发者_运维百科ads share a range  of  other  attributes
       (i.e., these attributes are process-wide rather than per-thread):

       ...

       -  signal dispositions

       ...

What do "signal dispositions" mean?


I signal disposition is the action a process takes when a signal is delivered. Each signal has a disposition. There are defaults.

From signal(7):

Signal Dispositions
    Each signal has a current disposition, which determines how the process
    behaves when it is delivered the signal.

[Dispositions are:]
    Term   Default action is to terminate the process.

    Ign    Default action is to ignore the signal.

    Core   Default action is to terminate the process and dump core (see core(5)).

    Stop   Default action is to stop the process.

    Cont   Default action is to continue the process if it is currently stopped.
[...]
    The signal disposition is a per-process attribute: in a multithreaded
    application, the disposition of a particular signal is the same for all
    threads.


The disposition of a signal is how it is handled.

  • It might be ignored
  • It might be handled using the default response (which depends on the signal)
    • stop
    • exit
    • exit with core dump
    • ignore
  • It might be handled by a user-defined signal handler

There can also be issues of signals masked while the signal handler is called, and so on.


This means how Unix process reacts to signals. See signal(7).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜