英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论