lkml.org 
[lkml]   [2009]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectDifference between atomic operations and memory barriers
From
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.


\
 
 \ /
  Last update: 2009-10-26 18:21    [W:0.071 / U:3.800 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site