public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Difference between atomic operations and memory barriers
@ 2009-10-26 17:19 Leonidas .
       [not found] ` <7ADB5FD7-9C97-4987-BC20-997258B25FD2@noahdesu.com>
  0 siblings, 1 reply; 16+ messages in thread
From: Leonidas . @ 2009-10-26 17:19 UTC (permalink / raw)
  To: linux-kernel

Trying to understand difference between atomic ops and memory barriers.

I was thinking all atomic operations must be using barrier internally,
but I read
somewhere that only some of them use barriers. Sorry for being vague here.

Operations before call to smp_mb() will not be re-ordered and all cpus will see
consistent value after the variable is updated.

E.g.
void * ptr = (void *) str;
smb_mb();

Will this not atomically update ptr? Ptr will be seen by all cpu's in
same state
after it has been assigned str, right?

-Leo.

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2009-10-28 13:26 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-26 17:19 Difference between atomic operations and memory barriers Leonidas .
     [not found] ` <7ADB5FD7-9C97-4987-BC20-997258B25FD2@noahdesu.com>
2009-10-26 18:22   ` Leonidas .
2009-10-26 18:54     ` Chris Friesen
2009-10-26 19:00       ` Leonidas .
2009-10-26 19:07         ` Noah Watkins
2009-10-26 19:34           ` Stefan Richter
2009-10-26 19:42             ` Noah Watkins
2009-10-27 11:51         ` Valdis.Kletnieks
2009-10-28 10:00           ` Boaz Harrosh
2009-10-28 13:26             ` Valdis.Kletnieks
2009-10-26 19:00     ` Stefan Richter
2009-10-26 19:05       ` Leonidas .
2009-10-27 10:21         ` Michael Schnell
2009-10-27 10:23           ` Leonidas .
2009-10-27 11:01             ` Michael Schnell
2009-10-27 14:57             ` Stefan Richter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox