In computer programming, particularly in the C, C++, C#, and Java programming languages, the volatile keyword indicates that a value may change between different accesses, even if it does not appear to be modified. This keyword prevents an optimizing compiler from optimizing away subsequent reads or writes and thus incorrectly reusing a stale value or omitting writes. Volatile values primarily arise in hardware access (memory-mapped I/O), where reading from or writing to memory is used to communicate with peripheral devices, and in threading, where a different thread may have modified a value....
> Lots of people love getters and setters, but Richard seemed to be in love with getters and setters. So much so that about 70% of his logic took place in them. More than once I deleted code that looked like this: foo.x = foo.x; Only to break entire pages, because the side effects of that assignment were doing everything.
Rather than explicitly using locks, the variable itself is "synchronized", so the waiting time for each thread will decrease because the amount of assembly code in the atomic section (only 1 thread can be running inside it at once) is smaller
A long time ago, I accidentally fixed a segfault in Java3D by adding a comment. It was 100% reproducible; if I removed the comment, it crashed. As long as the comment was there, it worked fine. I assume it was some bizarre timing issue, but I never did figure out exactly what was happening. — DNSMar 6 '09 at 14:29
@musicman523 javajee.com/unicode-escapes-in-java this is consistent (as expected from Java) and intended behavior (as expected from how bad Java is :P)
Yep, that's a similar error to the one I liked above in TIO
The \u000a in the comment is replaced with an actual linefeed character before compilation continues, so the rest of the "comment" isn't actually part of the comment
Oh I see, that example is actually on the page you lined