We use volatile
in one of our projects to maintain the same copy of variable accessed by different threads. My question is whether it is alright to use volatile
with static
. The compiler does not give any errors but I don't understand the reason of using both.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…