Help educate an old 8-bit assembler mindset
Help educate an old 8-bit assembler mindset
Posted Jun 20, 2021 7:29 UTC (Sun) by pbonzini (subscriber, #60935)In reply to: Help educate an old 8-bit assembler mindset by corbet
Parent article: Protecting control dependencies with volatile_if()
To state the obvious, this only applies if there aren't any other ways that the ordering is guaranteed, the most obvious of which would be a spinlock or mutex.
Control dependencies also do not matter in most lockless cases, much less control dependencies where the compiler does have meaningful optimizations that would break. Of course, sometimes they do.