A concurrent program consists of multiple tasks that behave as though they are all in progress at one time. On a system with a single processor, or where there are more tasks than processors, the system can switch between tasks, making it appear that more tasks than there are processors are executing at once. Threads may share access to memory with other threads, and may have means of coordinating their activities with those of other threads, the computer system, or the user to achieve the goals of the program. Writing concurrent programs requires looking at things in ways that are outside the experience of many programmers. Gaining this new perspective can be difficult.
Some approaches are academic and relatively inaccessible.
As a result, programming with threads has remained more or less a black art, practiced by the few who manage to figure it all out somehow. Of those, not all learn to use threads elegantly or reliably. Despite the relative simplicity of Java's threading model, writing concurrent programs in Java can still be strange and confusing. Most treatments of the Java language cover concurrent programming in a single chapter that introduces Java's thread classes but doesn't give the reader the conceptual background to program with threads effectively. This is the first book dedicated to concurrent programming in Java.