Top "Memory-barriers" questions

A memory barrier is a special processor instruction that imposes restrictions on the order in which memory accesses become visible to other processors/cores in a multi-processor or multi-core system.

Atomicity on x86

8.1.2 Bus Locking Intel 64 and IA-32 processors provide a LOCK# signal that is asserted automatically during certain critical memory operations to …

c++ multithreading x86 atomic memory-barriers
When should I use _mm_sfence _mm_lfence and _mm_mfence

I read the "Intel Optimization guide Guide For Intel Architecture". However, I still have no idea about when should I …

c++ multithreading x86 intrinsics memory-barriers
Which is a better write barrier on x86: lock+addl or xchgl?

The Linux kernel uses lock; addl $0,0(%%esp) as write barrier, while the RE2 library uses xchgl (%0),%0 as write barrier. What's …

assembly x86 memory-barriers
In OpenCL, what does mem_fence() do, as opposed to barrier()?

Unlike barrier() (which I think I understand), mem_fence() does not affect all items in the work group. The OpenCL …

opencl gpgpu memory-barriers barrier memory-fences
Are mutex lock functions sufficient without volatile?

A coworker and I write software for a variety of platforms running on x86, x64, Itanium, PowerPC, and other 10 year …

c++ multithreading mutex volatile memory-barriers
Behavior of memory barrier in Java

After reading more blogs/articles etc, I am now really confused about the behavior of load/store before/after memory …

java multithreading memory-barriers java-memory-model