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 Runnable
s.
• 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 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.