Java Thread Programming

a book by Paul Hyde

Java Thread Programming
Buy it:   [ISBN: 0672315858]
Table of Contents
Key Topics
About the Author
Download the Source Code

Customer Reviews on

One of the great features of Sun Microsystems' Java programming language is that is has built-in support for multithreaded programming. This book is for those of you who have started working with Java and have realized that you want to develop multithreaded applications and applets. It's easy to get started with threads, but their safe and proper use is tough to master. Java Thread Programming starts by demonstrating the basics of threads and moves on to advanced multithreaded concepts. This comprehensive book covers all thread-related issues in Java (including changes in Java 2) and shows how to write multithread-safe code.

Key topics:

  • Start by learning the basics of multithreaded programming in Java, and work up to the more advanced concepts.
  • Suitable tutorial for Java developers that have never worked with threads before, and an excellent reference and source of proven, advanced techniques for Java developers who have had experience working with threads.
  • Explains how volatile and synchronized should be used to control concurrent access to objects and variables and how to avoid deadlocks.
  • Discusses how to implement safe and efficient inter-thread communication using the wait-notify mechanism.
  • Explains how thread prioritization and scheduling affect the execution of threads within an application.
  • Discusses pros and cons to different approaches and teaches you how to choose the best solutions.
  • Covers the proper use of threads and Swing, and shows how to use threads to create animation.
  • Shows you how to use the Collections API in a thread-safe manner.
  • Comprehensively covers multithreaded code based on JDK 1.2 (Java 2) and discusses the differences from JDK 1.1 and JDK 1.0.
  • Includes advanced techniques that demonstrate how to create self-running objects, how to create a simple Web page server that uses thread pooling, how to break out of blocked I/O statements, and how to build a multithreaded First-In-First-Out (FIFO) queue.
  • Covers the complete API for Thread, ThreadGroup, ThreadLocal, and InheritableThreadLocal.
  • Includes ready-to-run examples --over 8,000 lines of Java code in over 100 complete classes.

Table of Contents:

  • Introduction
  • Part I - Threads
        1 - Introduction to Threads
        2 - Simple Two-Thread Example
        3 - Creating and Starting a Thread
        4 - Implementing Runnable versus
              Extending Thread
        5 - Gracefully Stopping Threads
        6 - Thread Prioritization
        7 - Concurrent Access to Objects
              and Variables
        8 - Inter-thread Communication
        9 - Threads and Swing
       10 - Thread Groups
  • Part II - Techniques
       11 - Self-running Objects
       12 - Exception Callback
       13 - Thread Pooling
       14 - Waiting For the Full Timeout
       15 - Breaking Out of a Blocked I/O State
       16 - SureStop Utility
       17 - BooleanLock Utility
       18 - First-In-First-Out (FIFO) Queue
  • Part III - Appendices
        A - Thread API
        B - ThreadGroup API
  • Index

About the Author:

Paul Hyde - Java Expert
[ email Paul ]
Resume Summary: [ full resume ] Paul Hyde
  • 8.5 years of intensive Java-specific experience!
  • 14 years of professional software development experience.
  • Author of the book: Java Thread Programming.
  • Sun Certified Web Component Developer for J2EE.
  • Sun Certified Programmer for the Java 2 Platform 1.4.
  • 9 years of part-time (evening) and some full-time teaching experience.
  • Developed curricula and taught Java I, Java II, Core Java, JDBC, Threads, XML, Servlets/JSP, EJB, Java Web Start, Swing, UML, Object Oriented Design Patterns, and HTML training classes.
  • Author of SimpleServlets open-source library.
  • Author of ProgramixGenericLib open-source library.
  • 7.5 years as President and Senior Consultant for Programix Incorporated.
  • Master of Science in Computer Science.
  • Bachelor of Science in Electrical Engineering.


There are instructions in the "Introduction" (page 1) of the book for downloading the source code from Sams Publishing, but these instructions may not work exactly as written due to re-organization of the site. For your convenience, the code is available below. This source code is only for use by people who have purchased a copy of Java Thread Programming.


page 34 - [ccc]
Lines 19 and 21 have a funny symbol "[ccc]" which should have been replaced by a continuation line arrow (see page 44, line 56 for an example) by the copy editor. The [ccc] text should be completely ignored. The downloadable source code does not have this typo.
page 175 - wait(long, int)
Middle paragraph refers to wait(long, int) and should instead point readers at wait(long).

Click here to buy: Java Thread Programming

[ Programix Home ]