Re: What does atomic_read actually do?
From: Brian Gerst
Date: Sat Dec 18 2004 - 16:05:26 EST
Joseph Seigh wrote:
On Sat, 18 Dec 2004 20:54:40 +0100, Arjan van de Ven
<arjan@xxxxxxxxxxxxx> wrote:
On Sat, 2004-12-18 at 14:20 -0500, Joseph Seigh wrote:
I mean atomic in the either old or new sense. I'm wondering what
guarantees
the atomicity. Not the C standard. I can see the gcc compiler uses
a MOV
instruction to load the atomic_t from memory which is guaranteed
atomic by
the architecture if aligned properly. But gcc does that for any old int
as far as I can see, so why use atomic_read?
it does so on *x86
Is this documented for gcc anywhere? Just because it does so doesn't
mean it's guaranteed.
Joe Seigh
ftp://download.intel.com/design/Pentium4/manuals/25366814.pdf
Chapter 7, section 1
--
Brian Gerst
-
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/