Why do I need a memory barrier?
Barrier #2 guarentees that the write to _complete gets committed immediately. Otherwise it could remain in a queued state meaning that the read of _complete in B would not see the change caused by A even though B effectively used a volatile read. Of course, this example does not quite do justice to the problem … Read more