Re: Sleep-Slowdown

Richard B. Johnson (root@chaos.analogic.com)
Tue, 21 Dec 1999 08:03:48 -0500 (EST)


On Tue, 21 Dec 1999, Jan-Friso Evers wrote:

> Hello,
>
>
> while developing a compiler (www.informatik.uni-kiel.de/~sacbase),
> a problem with newer linux-kernels occured.
>
> I tracked it down to the following:
[SNIPPED]

Before there was a sched_yield(), many programs were written to
give up the CPU for a bit by executing sleep(0). Whether or not
this is "good/bad/etc" is moot. Changing sleep to return immediately
without first scheduling, will cause such programs to eat up a
lot of CPU time, slowing other tasks down.

Look at `top` while executing:

for(;;)
;

Then look at it with:

for(;;)
sleep(0);

Then decide if you want tp break sleep().

Cheers,
Dick Johnson

Penguin : Linux version 2.3.13 on an i686 machine (400.59 BogoMips).
Warning : The end of the world as we know it requires a new calendar.
Seconds : 921372 (until Y2K)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/