You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This surprised me — I expected to see something like ptr::write_volatile here. Are you sure this code isn't working by accident?
I'm not too familiar with the exact semantics, but my guess would be that without volatile, these memory accesses are not considered side-effects, and therefore the compiler could, for example:
prove that our code won't read them (because of an upcoming infinite loop, for example), and decide remove them
move the write around some code that might not terminate, for example:
print("doing the thing... ");
some_mutex.lock().push(42);print("it worked!");
could get optimised to
some_mutex.lock().push(42);print("doing the thing... it worked!");
This would suck big time if you're trying to track down a deadlock.
Is this something you've given some thought, or merely an oversight?
The text was updated successfully, but these errors were encountered:
Currently, the code used to access VGA does plain memory pokes:
This surprised me — I expected to see something like
ptr::write_volatile
here. Are you sure this code isn't working by accident?I'm not too familiar with the exact semantics, but my guess would be that without volatile, these memory accesses are not considered side-effects, and therefore the compiler could, for example:
Is this something you've given some thought, or merely an oversight?
The text was updated successfully, but these errors were encountered: