3 ms·
The C language until very recently didn't know about threads or other kinds of concurrency. So the compiler was technically free to assume that the interrupt is
by Tomte 7y ago
The C language until very recently didn't know about threads or other kinds of concurrency. So the compiler was technically free to assume that the interrupt is never called. It's nowhere in the call tree that originates at main().
Of course, it didn't do that. Because vendors imparted their compilers with additional knowledge about common programming patterns and uses that aren't standard C.
- scottLobster 7y agoSo there are vendors out there that alter the behavior of volatile to act like a mutex in multi-threaded environments but don't tell anyone? Ugh. Well, TI doesn't do that thankfully. At least not for the MSP430.
- dirtydroog 7y agoHow did you draw that conclusion? People have been warning about volatile for years
- gpderetta 7y agofor a while Microsoft gave volatile acquire/release semantics, which implied a barrier on non-x86 cpus. They recognized it was a mistake backtracked on that around the time they started their effort to run Windows on ARM.