in reply to Re: Process Management
in thread Process Management
Although not directly related to the OP's question, this is still important.
There's a subtle bug in this code that I have seen repeatedly. This code assumes two potential returns from fork. The fork call actually has three potential return values, not two.
I learned about this when a long-running process started failing when it was moved to a much, much faster machine. It forked enough child processes in a burst to run out of process slots and then failed. Since the return was not true, it went on to do work as a child and exited when it was done. Now, the main process was gone.
Update: As almut pointed out, the undef case was dealt with in the else. I can only say that I'm a little oversensitive to this bug after losing a fair amount of time on the above case.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Process Management
by almut (Canon) on Jan 18, 2009 at 13:53 UTC | |
by gwadej (Chaplain) on Jan 19, 2009 at 14:18 UTC | |
|
Re^3: Process Management
by doom (Deacon) on Jan 18, 2009 at 09:03 UTC | |
by gwadej (Chaplain) on Jan 19, 2009 at 14:27 UTC |