Topics / Operating System Concepts / Q55
What is a compiler barrier versus a CPU memory barrier?
A compiler barrier restricts compiler reordering; a CPU barrier enforces specified hardware memory ordering. Neither alone necessarily provides both guarantees.