簡體   English   中英

Pthreads中的信號處理

[英]Signal Dispositions in Pthreads

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

       ...

“信號處置”是什么意思?

信號處理是信號傳遞過程中的一個動作。 每個信號都有一個配置。 有默認值。

信號(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.

信號的處理方式是如何處理的。

  • 它可能會被忽略
  • 它可能使用默認響應處理(取決於信號)
    • 出口
    • 退出核心轉儲
    • 忽視
  • 它可能由用戶定義的信號處理程序處理

在調用信號處理程序時,也可能存在屏蔽信號的問題,等等。

這意味着Unix進程如何對信號作出反應。 signal(7)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM