Question: The problem with the program is that the signal handler ( sig _ chld ) isn't designed to handle being interrupted by another instance of
The problem with the program is that the signal handler sigchld isn't designed to handle being interrupted by another instance of itself. When a signal arrives while sigchld is already running, the new instance interrupts the ongoing one. If this happens in the parent process, it could mess up the shared variable counter that both instances are trying to modify.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
