Re: interrupts and synchronization

Alan Cox (alan@lxorguk.ukuu.org.uk)
Mon, 8 Mar 1999 20:41:49 +0000 (GMT)


> for a network device driver I have to check a condition variable.
> If this is not set properly, I have to wait until it changes
> before I proceed with the processing of the package.

You can't do it that way

> Is there any easy solution to my problem, or is it impossible to
> do this way?

It is impossible to do that way. If you need to protect your condition
variable you probably actually want to disable interrupts while the
driver is unsafe to receive. If the driver is slow you should make the
irq routine atomically test a bit flag and queue the packet to a seperate
sk_buff queue for delayed processing. When you sort the condition out, clear
the bit flag and empty the delayed queue

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