Chapter 11. Multithreaded Programming in Java

One of Java's design goals was to be multithreaded. Whenever you run a Java program, there are multiple threads executing. Java provides the capability for you to easily add additional threads to your program. Adding threads is much simpler in Java than in languages like C or C++. This chapter will show you how to create and use threads to your advantage.

In Java, as in other languages, a thread is an execution context or subprocess. The Thread class is provided to run multiple threads in your program. You can use multiple threads for many tasks, such as printing a long document while the user continues to use the GUI. To assist you in using threads, this chapter covers

  • Thread states

  • Creating

Get PURE Java™ 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.