I saw an answer to a question regarding timing which used __sync_synchronize().
It is a atomic builtin for full memory barrier.
No memory operand will be moved across the operation, either forward or backward. Further, instructions will be issued as necessary to prevent the processor from speculating loads across the operation and from queuing stores after the operation.
Check details on the link above.
It forces a memory fence I guess.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With