In multi-threading, it is really important to that we have a good handle on how memory is shared across thread, how different locks can be used to solve visibility problems, and plain old current modification issues.
References:
- http://www.javaworld.com/article/2074217/java-concurrency/java-101–understanding-java-threads–part-1–introducing-threads-and-runnables.html – an Articles on basics of how threads work in Java JVM.
- Read every article in the Understanding Java threads series (Jeff Friesen, JavaWorld.com, 2002):
- For a glossary specific to this article, homework, tips, and more, see the Java 101 study guide that accompanies this article.
- For more information about exceptions and the run() method, read “Handling Uncaught Exceptions” ( Glen McCluskey, Java Developer Connection, January 2001).
- The Programming Java Threads in the Real World series uses common programming scenarios to introduce readers to programming Java threads (Alan Holub, JavaWorld.com, 1998-2001):
- Part 1: A Java programmer’s guide to threading architectures
- Part 2: The perils of race conditions, deadlock, and other threading problems
- Part 3: Roll-your-own mutexes and centralized lock management
- Part 4: Condition variables and counting semaphores—filling in a few chinks in Java’s threading model)
- Part 5: Has Sun abandoned run anywhere? PlusThreads and Swing, timers, and getting around stop(), suspend(), and resume() deprecation)
- Part 6: The Observer pattern and mysteries of the AWTEventMulticaster
- Part 7: Singletons, critical sections, and reader/writer locks
- Part 8: Threads in an object-oriented world, thread pools, implementing socket accept loops
- Learn more about Java: See the complete listing for Jeff Friesen’s Java 101 series — archived on JavaWorld.
- Also see the Java Tips series: More than five years of compiled tips from JavaWorld’s expert readers.
- Mutex and Memory Visibility
- http://gee.cs.oswego.edu/dl/jmm/cookbook.html – JSR-133 Cookbook – takes about threads and memory