Re: Idle loop in driver - attempt 2

Andi Kleen (ak@muc.de)
24 Dec 1999 12:25:11 +0100


LeeR@eicon.com (Lee Rhodes) writes:
>
> What we're after is critical sections. Does anyone have any suggestions?

It depends. If the critical region can sleep then you need semaphores
(include/asm/semaphore.h). If it doesn't and is accessed by interrupts
you use a spinlock_irqsave()/spinlock_irqrestore() [note that you should
minimize the critical region then because it is relatively nasty to the
system to turn interrupts off].

-Andi

-- 
This is like TV. I don't like TV.

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