[lkml]   [2006]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRE: Uses for memory barriers

> Am I correct? Or are there some easily-explained situations where mb()
> really should be used for inter-CPU synchronization?

Consider when one CPU does the following:

while(!spinlock_acquire()) relax();

We need to make sure we do not *read* the protected values (say due to
prefetching) before other CPUs see our write that locks the spinlock.


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

 \ /
  Last update: 2006-09-08 07:55    [W:0.055 / U:7.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site