Pthread 中的信号处理

发布于 2024-09-28 19:24:06 字数 302 浏览 1 评论 0原文

pthreadsman 页面提到:

 POSIX.1 also requires that threads share a range  of  other  attributes
       (i.e., these attributes are process-wide rather than per-thread):

       ...

       -  signal dispositions

       ...

“信号处置”是什么意思?

The man page for pthreads mentions:

 POSIX.1 also requires that threads share a range  of  other  attributes
       (i.e., these attributes are process-wide rather than per-thread):

       ...

       -  signal dispositions

       ...

What do "signal dispositions" mean?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

雨夜星沙 2024-10-05 19:24:06

信号处理是指传递信号时进程采取的操作。每个信号都有一个倾向。有默认值。

来自 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.

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.
执手闯天涯 2024-10-05 19:24:06

信号的处置是指如何处理信号。

  • 它可能会被忽略
  • 它可能会使用默认响应进行处理(这取决于信号)
    • 停止
    • 退出
    • 退出并进行核心转储
    • 忽略
  • 可能由用户定义的信号处理程序处理

也可能存在调用信号处理程序时信号被屏蔽的问题,等等。

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.

荒路情人 2024-10-05 19:24:06

这意味着 Unix 进程如何对信号做出反应。请参阅signal(7)

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文