Re: Problems with wait queues

From: Nicolas Bougues (nbougues@axialys.net)
Date: Wed Jun 26 2002 - 09:38:08 EST


Richard,

On Wed, Jun 26, 2002 at 10:17:45AM -0400, Richard B. Johnson wrote:
>
> I am sure that you can have things look correct as well as run
> properly. However, you didn't show us the code.

It's quite large, and I didn't think I was "syntactically" wrong. But
the code is available, if somebody wants to have a look.

> You need to do something like:
>
> interruptible_sleep_on(&semaphore);
>
> while your wake-up occurs with:
>
> wake_up_interruptible(&semaphore);
>

That's what I do, although I use the wait_event_interruptible macro
instead of interruptible_sleep_on.

>
> Both ways (and others) will look fine with `top` and will sleep
> properly.
>

If we're talking about %CPU times, right. If we're talking loadavg,
no. As I said in my previous message, I think it's because my
wake_up_interruptible() is *always* triggered during the timer
interrupt, just before the scheduler runs (new data is available every
100th/sec).

I'm not sure, but I think that the loadavg is computed at the
beginning of each scheduler run, thus, my task always looks "running"
at this time, even though it just runs for a few microseconds each
time.

--
Nicolas Bougues

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



This archive was generated by hypermail 2b29 : Sun Jun 30 2002 - 22:00:11 EST