Wrapup And Resources
The design of the Java language makes multithreading essential for all but the simplest applets. In particular, IO and GUI programming both require multithreading to provide a seamless experience for the user. By following the simple rules outlined in this article, as well as thoroughly designing a system -- including its access to shared resources -- before you've begun programming, you can avoid many common and difficult-to-detect threading pitfalls.
- Find the API specification for the Java 2 Platform, Standard Edition, version 1.3 at Java 2 API Documentation.
- For details about the JVM's treatment of threads and locks, see The Java Virtual Machine Specification.
- Allen Holub's
Taming Java Threads
(APress, June 2000) is an excellent reference.
- You may also want to read Allen's article If I were king: A proposal for fixing the Java programming language's threading problems (developerWorks, October 2000), which addresses what he calls the weakest aspect of a wonderful language.