SIGCHLDとは?
SIGCHLDは、子が終了、kill、または停止によって状態を変えるたびに親プロセスへ配送されるsignalです。親は通常、wait操作を呼んで子をreapし、そのexit statusを読むことでこれを処理します。reapせずに無視すると、親が動くまで子はzombieのまま残ります。
なぜ重要か
プロセスのスーパーバイザやshellは、起動したjobがいつ終わるかを知るためにSIGCHLDに依存します。これの扱いを誤ることは、長時間動作するrunnerでzombieプロセスが溜まる一般的な原因です。
関連ガイド
What Is a Signal Handler?A signal handler is a function a program registers to run when it receives a particular signal, letting it re…
What Is the Wait System Call?The wait system call lets a parent process pause until a child terminates and then read the child exit status…
What Is Reaping a Child Process?Reaping is when a parent calls a wait operation to read a finished child exit status, freeing the kernel slot…