Memory Barriers

Date Published:
Last Modified:


The one rule that compile-time and runtime memory re-ordering follows:

Never modify the behaviour of a **single threaded program**. - Memory re-ordering algorithms

However, if you are designing a multi-threaded program, you are out of luck. Memory re-ordering can mess with what you expect shared data to equal at any point in time.

Read the great tutorial on memory barriers at

Like this page? Upvote with shurikens!

Related Content:


comments powered by Disqus