As part of my quest to become a better developer, I've been reading more tech books (ok I'm trying to finish ONE tech book without lapsing into a coma, but I digress.) The thing is, it's a Java book. Technically it's a design patterns book, but all the code is in Java, so call it what you want...
Anyway, in my polylingual travels, I've been converting all the code in the book to vb.net for fun and to make sure I actually get what I'm doing. So today I stumbled across the Java keyword Volatile. I understand (basically) what it does for Java, but I don't really grok how to relate it back to VB.NET.
*For those of you wanting to know, Embedded.com has a pretty good description of the Volatile keyword, which follows:
"volatile is a qualifier that is applied to a variable when it is declared. It tells the compiler that the value of the variable may change at any time-without any action being taken by the code the compiler finds nearby."
So my question is, what if anything is the vb.net equivalent, and is it, in fact, actually needed with .net.
Just so you have some context, I'm playing with the Singleton Pattern. Most of the VB.NET examples I've seen on the web completely disregard thread safety for this pattern, opting to cover the much simpler, but not thread-safe, version of the pattern (which is little more than private constructor and public "getInstance" method.)
update: Further digging reveals that the Volatile keyword exists in C# as well, so there is obviously a need for it. This just reinforces my question as to what the corresponding VB.NET keyword (or pattern?) would be to handle this.