[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f22d86810910270323m6e004576ya4da96afc02e3d07@mail.gmail.com>
Date: Tue, 27 Oct 2009 03:23:12 -0700
From: "Leonidas ." <leonidas137@...il.com>
To: Michael Schnell <mschnell@...ino.de>
Cc: Stefan Richter <stefanr@...6.in-berlin.de>,
Noah Watkins <noah@...hdesu.com>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: Difference between atomic operations and memory barriers
On Tue, Oct 27, 2009 at 3:21 AM, Michael Schnell <mschnell@...ino.de> wrote:
> Leonidas . wrote:
>>
>> any_t *ptr = something;
>>
>> is always atomic even on SMPs without using locks, barriers then my
>> doubt is cleared. Thanks.
>
> I assume that this only holds if the pointer (not the thing it points
> to) is denoted as volatile.
>
> -Michael
>
I dont think so, volatile would only ensure no caching, so some cpus
might see the cached
pointer (this is where you would want to use barriers), but pointer
assignment would still be atomic.
-Leo.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists