Re: [RFC, 2.6] a simple FIFO implementation

From: Duncan Sands
Date: Fri Sep 17 2004 - 08:19:05 EST


> > Hi Stelian, what is to stop the compiler putting, say, "in" in a register
> > for the process calling __kfifo_get, so that it only sees a constant
> > value. Then after a while that process will think there is nothing
> > to get even though another process is shoving stuff into the fifo and
> > modifying "in".
>
> This can happen all right, but the buffer (or the indices) will not
> get corrupt (this is what I call coherent). Its just like the __kfifo_get()
> was executed entirely before the __kfifo_put().

Hi Stelian, that's not how I read the comment

+ * Note that with only one concurrent reader and one concurrent
+ * writer, you don't need extra locking to use these functions.

so maybe it is better to avoid confusion and be more explicit here.

Ciao,

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