in reply to Re: Re: Re: Re: Catching signals
in thread Catching signals
if i remember by Unix systems course, each process gets a slice of the processor, so even though one is stuck in the for (;;) loop, the other process should still execute.
A slice, in that sense, is a "time slice." Each process gets the cpu for a slice of time not for a single instruction or something. (Otherwise, there'd be a lot of overhead to no good purpose.)
So in that sense, here, a sleep = for ();
Not unless you can guarantee that the empty for loop won't complete before the child is able to complete setting its signal handler. The empty for loop is very quick. The sleep, on the other hand, actually blocks for a period of time. So, in no sense at all does a sleep equal a for loop.
-sauoq "My two cents aren't worth a dime.";
|
|---|