RE: user-mode port 0.44-2.4.7

James W. Lake (jim@intra.blueskylabs.com)
Wed, 25 Jul 2001 12:03:48 -0700


What about a case when you have a struct
struct queue
{
int head;
int tail;
...
} myqueue;
You update head in an isr and tail in one singular open fop_read() call.
Either don't mind getting old values of the one they don't update, want
to get the latest version of the variable as often as possible.
Should head and tail be volatile in the definition, or should they be
accessed with:
int head = (volatile)myqueue.head;
or with barrier() around the read/write?
Jim Lake

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