Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!wuarchive!rice!rice!sun-spots-request From: carver@atmos-modelling.chemistry.cambridge.ac.uk (Glenn Carver) Newsgroups: comp.sys.sun Subject: Child control with the Notifier Keywords: Windows Message-ID: <1990Oct8.000622.11028@rice.edu> Date: 5 Oct 90 09:40:14 GMT Sender: sun-spots-request@rice.edu Organization: Sun-Spots Lines: 35 Approved: Sun-Spots@rice.edu Originator: spots@walhalla.rice.edu X-Sun-Spots-Digest: Volume 9, Issue 317, message 7 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 , so that after 30 passes of the loop I have 30 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@atm.ch.cam.ac.uk