Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Comment on use of VOLATILE in the JLS.?

comment jls volatile
0
10 Posted

Comment on use of VOLATILE in the JLS.?

0
10

>It is my opinion and my experience that inclusion >of VOLATILE in Java has lead to nothing but confusion >and bad coding practices. *Personally*, I completely agree. >ANYWAY, I think it would be of some value to include a >statement of where VOLATILE is and isn’t useful and >examples of same. In particular, that VOLATILE is almost >always the WRONG thing to use, and that programmers >should avoid it unless they have a VERY clear understanding >of the consequences. We might be able to squeeze something in. However, bear in mind that the primary purpose of the JLS is to specify the language semantics, not to teach people how to use it. [Some time after this exchange, the issue of the description of the memory model required by Java popped up led by Lea & Pugh. The gist of this is that a pile of details will be fixed AND VOLATILE will be given more adaquate semantics, making it POSSIBLE to use correctly. It will still be *VERY* difficult and should still be avoided.] ********************

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123