Open Source Your Knowledge, Become a Contributor

Technology knowledge has to be shared and made accessible for free. Join the movement.

Create Content

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:

Open Source Your Knowledge: become a Contributor and help others learn. Create New Content