Buying Options
Java Threads, Second Edition
Safari Books Online
Add to Cart
What is this?

Product Editions

Please consider the latest edition.

  1. Java Threads, Third Edition - September 2004
  2. Java Threads, Second Edition - January 1999
  3. Java Threads - February 1997 (out of print)
Description
Revised and expanded to cover Java 2, Java Threads shows you how to take full advantage of Java's thread facilities: where to use threads to increase efficiency, how to use them effectively, and how to avoid common mistakes. It thoroughly covers the Thread and ThreadGroup classes, the Runnable interface, and the language's synchronized operator. The book pays special attention to threading issues with Swing, as well as problems like deadlock, race condition, and starvation to help you write code without hidden bugs.
Full Description
Table of Contents
  1. Chapter 1 Introduction to Threading

    1. Java Terms

    2. Thread Overview

    3. Why Threads?

    4. Summary

  2. Chapter 2 The Java ThreadingAPI

    1. Threading Using the Thread Class

    2. Threading Using the Runnable Interface

    3. The Life Cycle of a Thread

    4. Thread Naming

    5. Thread Access

    6. More on Starting, Stopping, and Joining

    7. Summary

  3. Chapter 3 Synchronization Techniques

    1. A Banking Example

    2. Reading Data Asynchronously

    3. A Class to Perform Synchronization

    4. The Synchronized Block

    5. Nested Locks

    6. Deadlock

    7. Return to the Banking Example

    8. Synchronizing Static Methods

    9. Summary

  4. Chapter 4 Wait and Notify

    1. Back to Work (at the Bank)

    2. Wait and Notify

    3. wait(), notify(), and notifyAll()

    4. wait() and sleep()

    5. Thread Interruption

    6. Static Methods (Synchronization Details)

    7. Summary

  5. Chapter 5 Useful Examplesof Java Thread Programming

    1. Data Structures and Containers

    2. Simple Synchronization Examples

    3. A Network Server Class

    4. The AsyncInputStream Class

    5. Using TCPServer with AsyncInputStreams

    6. Summary

  6. Chapter 6 Java Thread Scheduling

    1. An Overview of Thread Scheduling

    2. When Scheduling Is Important

    3. Scheduling with Thread Priorities

    4. Popular Scheduling Implementations

    5. Native Scheduling Support

    6. Other Thread-Scheduling Methods

    7. Summary

  7. Chapter 7 Java Thread Scheduling Examples

    1. Thread Pools

    2. Round-Robin Scheduling

    3. Job Scheduling

    4. Summary

  8. Chapter 8 Advanced Synchronization Topics

    1. Synchronization Terms

    2. Preventing Deadlock

    3. Lock Starvation

    4. Thread-Unsafe Classes

    5. Summary

  9. Chapter 9 Parallelizing for Multiprocessor Machines

    1. Parallelizing a Single-Threaded Program

    2. Inner-Loop Threading

    3. Loop Printing

    4. Multiprocessor Scaling

    5. Summary

  10. Chapter 10 Thread Groups

    1. Thread Group Concepts

    2. Creating Thread Groups

    3. Thread Group Methods

    4. Manipulating Thread Groups

    5. Thread Groups, Threads, and Security

    6. Summary

  1. Appendix A Miscellaneous Topics

    1. Thread Stack Information

    2. General Thread Information

    3. Default Exception Handler

    4. The ThreadDeath Class

    5. The Volatile Keyword

  2. Appendix B Exceptions and Errors

    1. InterruptedException

    2. InterruptedIOException

    3. NoSuchMethodError

    4. RuntimeException

  3. Colophon

View Full Table of Contents
Product Details
Title:
Java Threads, Second Edition
By:
Scott Oaks, Henry Wong
Publisher:
O'Reilly Media
Formats:
  • Print
  • Safari Books Online
Print Release:
January 1999
Pages:
344
Print ISBN:
978-1-56592-418-5
| ISBN 10:
1-56592-418-5
Customer Reviews
About the Authors
  1. Scott Oaks

    Scott Oaks is a Java Technologist at Sun Microsystems, where he has worked since 1987. While at Sun, he has specialized in many disparate technologies, from the SunOS kernel to network programming and RPCs. Since 1995, hes focused primarily on Java and bringing Java technology to end-users. Scott also authored OReillys Java Security, Java Threads and Jini in a Nutshell titles.

    View Scott Oaks's full profile page.

  2. Henry Wong

    Henry Wong is a tactical engineer at Sun Microsystems, where he has worked since 1989. Originally hired as a consultant to help customers with special device drivers, kernel modifications, and DOS interoperability products, Henry has also worked on Solaris ports, performance tuning projects, and multithreaded design and implementations for benchmarks and demos. Since early 1995, Henry has been involved in developing Java prototypes and supporting customers who are using Java. Prior to joining Sun, Henry earned a bachelor of science degree in chemical engineering from The Cooper Union in 1987. He joined a small software company in 1986 working on SCSI device drivers, image and audio data compression, and graphics tools used for a medical information system. When not in front of a computer, Henry is an instrument rated private pilot, who also likes to dabble in archery, cooking, and traveling to different places with his wife, Nini.

    View Henry Wong's full profile page.

Colophon

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, Second Edition, is a scyphomedusa (Atolla vanhoeffeni), a luminescent jellyfish common throughout the world's oceans at depths of 500 to 1,000 meters. They are 3 to 5 centimeters in diameter, with 20 short, stiff tentacles and one long tentacle that trails behind. Although they are eaten in some countries, jellyfish aren't particularly nutritious; less than one percent of a jellyfish body is organic matter, and everything else is water. Madeleine Newell was the production editor for Java Threads, 2nd Edition. Cindy Kogut of Editorial Ink copyedited this edition. Quality control was provided by Jane Ellin, Melanie Wang, and Sheryl Avruch. Seth Maislin wrote the index.

The cover was designed by Emma Colby using 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.

The inside layout was designed by Nancy Priest. Text was formatted in FrameMaker 5.5 by Mike Sierra. The heading font is Bodoni BT; the text font is New Baskerville. The illustrations that appeared in the first edition of this book were created in Macromedia Freehand 5.0 by Chris Reilley; for this edition, the illustrations were created and updated by Rob Romano using Macromedia Freehand 8 and Adobe Photoshop 5. This colophon was written by Leanne Soylemez.

  • Book cover of Java Threads