Path: utzoo!censor!geac!torsqnt!jarvis.csri.toronto.edu!dgp.toronto.edu!lansd From: lansd@dgp.toronto.edu (Robert Lansdale) Newsgroups: comp.sys.sgi Subject: How to kill tasks after a user abort? Message-ID: <1990Mar4.121456.14599@jarvis.csri.toronto.edu> Date: 4 Mar 90 17:14:56 GMT Distribution: na Lines: 31 I have been running my 3d renderer successfully in parallel on our 4D/140 for several months now, but I have yet to get the ^C signal handling (SIGINT) to terminate the tasks gracefully. My renderer is set up so the user may abort the display process (which runs in parallel using tasks distributed with taskcreate()) by typing ^C, at which point the signal handler shuts the display code down and kills any stray tasks (I've noticed that random tasks get killed when SIGINT is seen - is this documented anywhere??). The signal handler then does a long jump back to the command line parser. The parent process is usually asleep while the tasks are running (it distributes work to the tasks and goes to sleep in a uspsema() statement). So how do I assure that the parent process gets woken and becomes the first process to enter the signal handler? I've (carefully) read through the signal man page several times and tried a number of variations of the SIGCLD signal catcher, but I still find that the parent process is getting stuck occansionally in the printf() routine when it is about to print that the display code is shutdown (printf() -> Psema() -> blockproc() ...). This printf() is part of the signal handling code. Any pointers would be most appreciated. Thanks. --> Rob Lansdale ---------------------------------------------------------------------------- Robert Lansdale - (416) 978-6619 Dynamic Graphics Project Internet: lansd@dgp.toronto.edu Computer Systems Research Institute UUCP: ..!uunet!dgp.toronto.edu!lansd University of Toronto Bitnet: lansd@dgp.utoronto Toronto, Ontario M5S 1A4, CANADA