View Single Post
  #2 (permalink)  
Old 07-18-2007, 05:59 AM
goldhouse goldhouse is offline
Senior Member
 
Join Date: Mar 2007
Posts: 136
goldhouse is on a distinguished road
Yes , I got a reason for making the two as different .
Look we have scenario like this say we have two threads

First thread need to set the variable for the next thread
Second thread comes & checks the variable & finds it's not set , it return without doing it's task

Only volatile can solve this problem

So the conclusion is volatile is not a replacement for synchronization and vice versa
Reply With Quote