部分 SIGCHLD 未传递到 signalfd

huangapple go评论60阅读模式
英文:

Part of SIGCHLD not coming to signalfd

问题

主进程启动进程 proc1、proc2、proc3。以非阻塞模式创建 SIGCHLD 的 signalfd。
我通过你的文本 pkill proc 杀死子进程。然后不同的情况发生,从 signalfd 中可以读取 1 或 2 个信号(第二个信号在进入 poll 后读取)。

第三个信号在哪里?

我不明白该尝试什么。没有信号传递到 fd 吗?

英文:

the master process starts the processes proc1, proc2, proc3. creating a signalfd for SIGCHLD in non-blocking mode.
I kill child processes through your text pkill proc. Then different situations happen, from signalfd it is possible to read either 1 or 2 signals (the second signal reads after entering poll).

where is the third signal?

I don't understand what to try. no signal coming to fd?

答案1

得分: 0

"第三个信号在哪里?"
"从您的描述中很难确定确切的情况,但很可能您遇到了相同类型的信号不排队的情况。例如,对于给定进程,只能有一个 SIGCHLD 处于等待状态。如果在一个已经等待的信号到达时又来了一个信号,那么这两个信号中的一个将被丢弃。"

英文:

> where is the third signal?

It's impossible to know from your description alone exactly what is happening, but very likely you're running into the fact that signals of the same type do not queue. For example, only one SIGCHLD can be pending for a given process at a time. If a second comes in while one is already pending, then one of the two is dropped.

huangapple
  • 本文由 发表于 2023年6月8日 19:41:28
  • 转载请务必保留本文链接:https://go.coder-hub.com/76431501.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定