Question about memory barriers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


The kernel's documentation about memory barriers is rather skimpy.  I 
gather that rmb() guarantees that all preceding reads will have completed 
before any following reads are made, and wmb() guarantees that all 
preceding writes will have completed before any following writes are made.  
I also gather that mb() is essentially the same as rmb() and wmb() put 

But suppose I need to prevent a read from being moved past a write?  It 
doesn't look like either rmb() or wmb() will do this.  And if mb() is the 
same as "rmb(); wmb();" then it won't either.  So what's the right thing 
to do?

Alan Stern

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at
Please read the FAQ at

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux