Back
Close

Computing with Data

elgeish
499.1K views

Volatility - Part II

More importantly, declaring a shared resource as volatile can be misleading as it may give a false sense of thread safety; it's crucial to know that the mere act of sprinkling the keyword volatile on fields doesn't guarantee thread safety and definitely doesn't protect against concurrency issues. Let's take the following simple task as an example:

Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io