Re: How to sleep a kernel thread?

From: Francis GALIEGUE (fg@mandrakesoft.com)
Date: Sat Jun 03 2000 - 06:50:54 EST


On Sat, 3 Jun 2000, Matthew Dharm wrote:

> Will a wait queue work in the situation where we do a "wake up" before the
> thread is actually "sleeping"?
>

Yes. Waking up an empty queue just returns.

> And what happens if we do wake-ups faster than we sleep -- do wake-ups have
> an incrementing counter of some sort, or will we lose the multiple wake-ups?
>

See above. But I don't really see the problem here: your events are queued
anyway, so why would this matter?

> And what if we don't want to be interrupted? Does that still count as
> running?
>

You may then use the normal sleep_on() and wake_up(), instead of
interruptible_sleep_on() and wake_up_interruptible(). But this means that the
task will be in D state, ie TASK_UNINTERRUPTIBLE while it takes a nap. But I
bet you know what you are doing :)

-- 
fg

"You can tune a filesystem but you can't tuna fish" (HP/UX' fsck manpage)

- 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/



This archive was generated by hypermail 2b29 : Wed Jun 07 2000 - 21:00:17 EST