-
Chapter 1 Introduction to Threads
-
Java Terms
-
About the Examples
-
Why Threads?
-
Summary
-
-
Chapter 2 Thread Creation and Management
-
What Is a Thread?
-
Creating a Thread
-
The Lifecycle of a Thread
-
Two Approaches to Stopping a Thread
-
The Runnable Interface
-
Threads and Objects
-
Summary
-
-
Chapter 3 Data Synchronization
-
The Synchronized Keyword
-
The Volatile Keyword
-
More on Race Conditions
-
Explicit Locking
-
Lock Scope
-
Choosing a Locking Mechanism
-
Nested Locks
-
Deadlock
-
Lock Fairness
-
Summary
-
-
Chapter 4 Thread Notification
-
Wait and Notify
-
Condition Variables
-
Summary
-
-
Chapter 5 Minimal Synchronization Techniques
-
Can You Avoid Synchronization?
-
Atomic Variables
-
Thread Local Variables
-
Summary
-
-
Chapter 6 Advanced Synchronization Topics
-
Synchronization Terms
-
Synchronization Classes Added in J2SE 5.0
-
Preventing Deadlock
-
Deadlock Detection
-
Lock Starvation
-
Summary
-
-
Chapter 7 Threads and Swing
-
Swing Threading Restrictions
-
Processing on the Event-Dispatching Thread
-
Using invokeLater( ) and invokeAndWait( )
-
Long-Running Event Callbacks
-
Summary
-
-
Chapter 8 Threads and Collection Classes
-
Overview of Collection Classes
-
Synchronization and Collection Classes
-
The Producer/Consumer Pattern
-
Using the Collection Classes
-
Summary
-
-
Chapter 9 Thread Scheduling
-
An Overview of Thread Scheduling
-
Scheduling with Thread Priorities
-
Popular Threading Implementations
-
Summary
-
-
Chapter 10 Thread Pools
-
Why Thread Pools?
-
Executors
-
Using a Thread Pool
-
Queues and Sizes
-
Thread Creation
-
Callable Tasks and Future Results
-
Single-Threaded Access
-
Summary
-
-
Chapter 11 Task Scheduling
-
Overview of Task Scheduling
-
The java.util.Timer Class
-
The javax.swing.Timer Class
-
The ScheduledThreadPoolExecutor Class
-
Summary
-
-
Chapter 12 Threads and I/O
-
A Traditional I/O Server
-
A New I/O Server
-
Interrupted I/O
-
Summary
-
-
Chapter 13 Miscellaneous Thread Topics
-
Thread Groups
-
Threads and Java Security
-
Daemon Threads
-
Threads and Class Loading
-
Threads and Exception Handling
-
Threads, Stacks, and Memory Usage
-
Summary
-
-
Chapter 14 Thread Performance
-
Overview of Performance
-
Synchronized Collections
-
Atomic Variables and Contended Synchronization
-
Thread Creation and Thread Pools
-
Summary
-
-
Chapter 15 Parallelizing Loops for Multiprocessor Machines
-
Parallelizing a Single-Threaded Program
-
Multiprocessor Scaling
-
Summary
-
-
Appendix A Superseded Threading Utilities
-
The BusyFlag Class
-
The CondVar Class
-
The Barrier Class
-
The RWLock Class
-
The ThreadPool Class
-
The JobScheduler Class
-
Summary
-
-
Colophon
- Title:
- Java Threads, Third Edition
- By:
- Scott Oaks, Henry Wong
- Publisher:
- O'Reilly Media
- Formats:
-
- Ebook
- Safari Books Online
- Print Release:
- September 2004
- Ebook Release:
- June 2009
- Pages:
- 360
- Print ISBN:
- 978-0-596-00782-9
- | ISBN 10:
- 0-596-00782-5
- Ebook ISBN:
- 978-0-596-55666-2
- | ISBN 10:
- 0-596-55666-7
Our look is the result of reader comments, our own experimentation, and feedback from distribution channels. Distinctive covers complement our distinctive approach to technical topics, breathing personality and life into potentially dry subjects. The animal on the cover of Java Threads, Third Edition is a marine invertebrate. Invertebrates, or animals without backbones, make up over 97 percent of all animal species on the planet. Marine invertebrates are abundant in every ocean, and include such diverse species as crabs, sea cucumbers, jellyfish, starfish, urchins, anemones, and shrimps. One of the most intelligent animals in the sea, the octopus, is also an invertebrate.
Many invertebrates have protective shells to shield them from hungry, razor-toothed predators. You may think that invertebrates without shells would be particularly vulnerable,but many have developed some effective defenses. Sea anemones brandish tentacles that sting their enemies,urchins have sharp spikes that cover their entire bodies, and sea slugs just don't taste very good.
Though you may not realize it, marine invertebrates are quite beneficial to humans. For one, they constitute a huge food source. Shrimps, crabs, octopuses, clams, oysters, squids, lobsters, scallops, and crayfish are all tasty delicacies. Invertebrates are also nature's vacuum cleaners, taking in dead and discarded material and recycling it through the food chain. And after millions of years, the bodies of invertebrates settle on the sea floor and form oil deposits, a major source of the world's energy. Matt Hutchinson was the production editor for Java Threads, Third Edition. Octal Publishing, Inc. provided production services. Sarah Sherman, Marlowe Shaeffer, and Claire Cloutier provided quality control.
Emma Colby designed the cover of this book, based on a series design by Edie Freedman. The cover image is a 19th-century engraving from the Dover Pictorial Archive. Emma Colby produced the cover layout with QuarkXPress 4.1 using Adobe's ITC Garamond font.
David Futato designed the interior layout. This book was converted by Joe Wizda to FrameMaker 5.5.6 with a format conversion tool created by Erik Ray, Jason McIntosh, Neil Walls, and Mike Sierra that uses Perl and XML technologies. The text font is Linotype Birka; the heading font is Adobe Myriad Condensed; and the code font is LucasFont's TheSans Mono Condensed. The illustrations that appear in the book were produced by Robert Romano and Jessamyn Read using Macromedia FreeHand 9 and Adobe Photoshop 6. This colophon was written by Matt Hutchinson.
