Child control with the Notifier

Glenn Carver carver at atmos-modelling.chemistry.cambridge.ac.uk
Fri Oct 5 19:40:14 AEST 1990


I'm having problems trying to get the child control that I need with an
application using SunView.

The structure of the program comprises main.c which sets up the
application window and calls window_main_loop().  Then when the user
presses a button on the window, a notify procedure gets called which
consists of a loop over roughly 100 iterations.  On each pass of the loop,
a child is created to perform a small task.  The time of the child in
relation to the time of each loop pass is small so each child terminates
before the next child is created. 

My problem is that I cannot avoid the maximum process limit. Normally, a
wait(2) call would clear the terminated child. However, according to the
SunView manual, I cannot do a wait(2) call using SunView but have to
register a wait3 event handler via notify_set_wait3_func().

I tried registering the default handler notify_default_wait3() but this
did not help. While the program was running, using the ps command still
shows child processes that are <exiting>, so that after 30 passes of the
loop I have 30 <exiting> children.  However, when the loop and my notify
proc terminate and control returns to the notifier, the child processes
disappear.  This suggests that the child processes are not fully 'reaped'
until control returns to the notifier.

Is there any way out of this?  Can I, for example, register my own wait3
event handler which itself calls wait(2), or does this still violate the
notify convention. Or alternatively, can I force the notifier to do a
wait() whilst still in the loop to remove the child process previously
created completely.

Please email me directly.  I will summarise.  All help much
appreciated. Currently using SunOS 3.5.

Glenn Carver                              Phone (44-223) 336521
Cambridge University, UK.        email: carver at atm.ch.cam.ac.uk



More information about the Comp.sys.sun mailing list