You need to use special mechanisms to guarantee that communication happens between these threads, as you would on a message passing system.Each thread in Java takes place in a separate memory space (this is clearly untrue, so bear with me on this one).As of today, the best way I can think of to describe it is if you imagine it this way: I've struggled a bit over the years to explain it briefly and well. ![]() I've sort-of covered this in other posts, such as my posting on the ++ operator, my post on double-checked locking and the like, but I've never really addressed it directly.įirst, you have to understand a little something about the Java memory model. Today, I'm going to talk about what volatile means in Java.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |