18. Multithreading

Objectives

In this chapter you’ll learn:

• What threads are and why they are useful.

• How threads enable you to manage concurrent activities.

• The life cycle of a thread.

• Thread priorities and scheduling.

• To create and execute Runnables.

• Thread synchronization.

• What producer/consumer relationships are and how they are implemented with multithreading.

• To enable multiple threads to update Swing GUI components in a thread-safe manner.

• About interfaces Callable and Future, which you can use with threading to execute tasks that return results.

The most general definition of beauty...Multeity in Unity.

Samuel Taylor Coleridge

Do not block the way of inquiry.

Charles Sanders Peirce

A person with one watch knows ...

Get Java™ for Programmers: Deitel now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.