Chapter 23. Multithreading
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 what time it is; a person with two watches is never sure.
—Proverb
Learn to labor and to wait.
—Henry Wadsworth Longfellow
The world is moving so fast these days that the man who says it can’t be done is generally interrupted by someone doing it.
—Elbert Hubbard
Objectives
In this chapter you’ll learn:
• What threads are and why they’re useful.
• How threads enable you to manage concurrent activities.
• The life cycle of a thread.
• To create and execute Runnable
s.
• Thread synchronization.
• What producer/consumer relationships are and ...
Get Java™ for Programmers: Deitel Developer Series, Second Edition 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.