#: 21361 S12/OS9/68000 (OSK)
07-Feb-96 04:06:12
Sb: #21359-Checking on dead parents
Fm: Ian J Shearer 100410,2733
To: Bob van der Poel 76510,2203 (X)
Bob,
>> It would be nice if the child could be notified if the parent dies <<
Since you say 'if the parent dies a sudden death' I guess you can't signal the
child from the parent, since the death is unexpected. You could have the child
check that the parent is still there, however.
It's a while since I did this, so you might need to improvise a little. Try
having the parent pass the child the parent process id. At regular intervals,
the child then fetches the parents process descriptor using _os_gprdsc(). If
the parent is dead I THINK you should get an error from that call.
I used to do a similar thing when I had problems with a process locking up on
I/O. From the process descriptor (if I remember correctly) you can get the info
normally shown by the 'procs' utility, so you can tell if all I/O activity on a
process has halted, or if it's not taking any CPU time.
Hope this helps.
-Ian J Shearer, Onyx Systems Ltd.
WWW - http://ourworld.compuserve.com/homepages/OnyxSystems
|