Posted Aug 3, 2012 16:53 UTC (Fri) by PaulMcKenney (subscriber, #9624)
In reply to: ACCESS_ONCE() by tvld
Parent article: ACCESS_ONCE()
I cannot say that I found your concerns convincing, and your further commentary isn't helping to convince me.
So rather that continue that sterile debate, let me ask a question on the examples in the article. In C11/C++11, would it be sufficient to make the ->owner field be atomic with memory_order_relaxed accesses, or would the volatile cast still be necessary to prevent the compiler from doing those optimizations?