4 Dec
2014
4 Dec
'14
12:45 p.m.
Gavin Lambert wrote:
Out of curiosity, while I agree that the latter is better than the former, how would this compare:
while( f_.exchange( true, std::memory_order_acquire ) ) { while( f_.load( std::memory_order_relaxed ) ) { /* maybe yield */ } }
I think that you're right, this should indeed be better.