Posted Aug 3, 2012 7:53 UTC (Fri) by dvdeug (subscriber, #10998)
In reply to: ACCESS_ONCE() by PaulMcKenney
Parent article: ACCESS_ONCE()
Then again, as mentioned below in the comments section, there is a guaranteed reliable way of doing this in C; it's declaring the variable volatile. This little trick may be within the C standard, but I'm pretty sure the people adding volatile to C never expected "(*(volatile typeof(x) *)&(x))". Some programmers use every trick to optimize their code, then expect the compiler to maximally optimize their code while understanding all of their little tricks.