July 2018
Intermediate to advanced
266 pages
7h 11m
English
There are still some scenarios in which using volatile variables can help us write better code. These scenarios are based on two premises, both of which need to be true – if either of them is false then a different solution needs to be implemented:
The first premise helps to rule out scenarios like the thread-safe counter: because the change in the state is not atomic, future values can't safely depend on the current one.
The second premise, on the other hand, helps us to avoid the creation of inconsistent states because of dependencies from or ...
Read now
Unlock full access