• Post Reply Bookmark Topic Watch Topic
  • New Topic

volatile variables

 
Gladstone Benjamin
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,
I've been a visitor to JavaRanch for several months and have come to realize that the SCJP exam is heavy on threads. My only problem with the concept of threads are volatile variables. If a certain instance variable that is shared by several thread is cached for optimization puposes, how many copies of this variable can be created? Also, what variable is the "master" of a variable modified as volatile?
Thanks
 
Jim Baiter
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at section 8.3.1.4 of the Java language specification. It answers these questions.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!