One of the most appealing features in Java is its support for easy thread programming. Prior to 1995, the year Java was released, threads were the domain of programming experts only. With Java, even beginners can write multi-threaded applications.
This chapter explains what threads are and why they are important. It also talks about related topics such as synchronization and the visibility problem. The Concurrency Utilities, discussed in Chapter 25, provides a better and easier way of working with threads.
A program can allocate processor time to units in its body. Each unit is then given a portion of the processor time. Even if your computer only has a single-core processor, it ...