Date: 2007-04-12 08:47 pm (UTC)
Well, the problem is exactly that if some value is in a CPU register, calling MemoryBarrier() is not going to update it. You need to call MemoryBarrier() and then also reload the new consistent value from memory (more specifically, from cache that is now known to be consistent with memory) to the CPU register. Since the compiler/optimizer makes the decisions about what and when is going from the memory to the CPU registers, you need to communicate the idea of careful treatment your variable to the compiler. The keyword "volatile" does that.
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

July 2025

S M T W T F S
  12345
6789 1011 12
13141516171819
20212223242526
2728293031  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 13th, 2025 01:18 pm
Powered by Dreamwidth Studios