In my professional career I’ve came across some issues around Java volatil variables, it comes very handy when multi-core computers arrived. The semantic in Java has changed in it’s 5th version, and it still is a bad documented, badly known and used concept. So it’s time to stop, think, read, learn and mature the concepts. So, what it is? Why do we need it? And most important, should we try to use it?
ThreadLocal, what an useful class. I’ve used it several times, I know what it allows me to do, but yet I don’t know how it is, actually, implemented, so in detail, what does it offers me?
Java provides a set of useful classes in it’s java.util.concurrent.atomic package. This package contains a small toolkit of classes that support lock-free (at least whenever possible) and thread-safe programming on single variables. But how can it be lock-free (or what does that mean)? How useful they are? When to use them?
© 2019 Joao Melo's Blog | Theme by Eleven Themes