Does using volatility make sense only on multiprocessor systems?

The use of volatility makes sense only in multiprocessor systems. it is not right?

I'm trying to learn about thread programming, so if you know any good articles / pdfs ... I like stuff that is a bit reminiscent of how the operating system works, not just the language syntax.

+3
source share
4 answers

volatile is used to ensure that the entire stream sees the same copy of the data. If a field has only one read / write stream, it does not have to be volatile. It will work just fine, just be a little slower.

Java , , .

Java Concurrency , , , http://www.javaconcurrencyinpractice.com/

Java - , .. , , , , .;)

+8

. Volatile . .

+10

Volatile , , . volatile JVM ( Java), . , Threads, volatile, .

. Java . Volatile.

+1

. Volatile concurrency. .

This article from Brian Goetz’s article really helped me understand volatile. He has several examples of use volatile, and he explains under what conditions it can be used.

+1
source

Source: https://habr.com/ru/post/1783681/


All Articles