Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!seismo!mcvax!unido!iaoobelix!wagner From: wagner@iaoobelix.UUCP Newsgroups: comp.unix.questions Subject: Re: Suspending processes - (nf) Message-ID: <8200002@iaoobelix.UUCP> Date: Mon, 12-Jan-87 21:29:00 EST Article-I.D.: iaoobeli.8200002 Posted: Mon Jan 12 21:29:00 1987 Date-Received: Sun, 18-Jan-87 00:20:30 EST References: <836@A60.UUCP> Lines: 24 Nf-ID: #R:A60:-83600:iaoobelix:8200002:000:880 Nf-From: iaoobelix!wagner Jan 13 03:29:00 1987 /***** iaoobelix:comp.unix.ques / A60!lee / 4:13 pm Jan 9, 1987*/ > Does UNIX provide a standard way to suspend a processes ( stop it > from getting CPU time )? > -- > Gene Lee UUCP: ...ihnp4!{meccts,dayton,rosevax}!ems!A60!lee > Sperry Corporation ATT: (612) 635-6334 There are two possiblilities: Use something like kill(pid,SIGSTOP) to suspend the process and use kill(pid,SIGCONT) to resume. Note: These signals cannot be blocked, so this is a safe way to suspend a process. Setup a handler which suspends the process upon receiving a specific signal, and which wakes up when it receives another signal. (see man pages for sigpause(2), signal(2)). Of course a process can suspend itself at any time it wants to: just call sleep(3) or usleep(3)... Juergen Wagner, (USENET) ...!unido!iaoobel!wagner Fraunhofer Institute IAO, Stuttgart