BUY THIS BOOK
Add to Cart

Print Book $39.95


Add to Cart

PDF $31.99

Safari Books Online

What is this?

Add to UK Cart

Print Book £28.50

What is this?

Looking to Reprint or License this content?

Java Threads, Third Edition

By Scott Oaks, Henry Wong
Third Edition  September 2004 
Pages: 358
ISBN 10: 0-596-00782-5 | ISBN 13: 9780596007829
starstarstarstarstar (Average of 2 Customer Reviews)

Buy 2 Get 1 Free Free ShippingGuarantee

Book description

Threads are essential to Java programming, but learning to use them effectively is a nontrivial task. This new edition of the classic Java Threads shows you how to take full advantage of Java's threading facilities and brings you up-to-date with the watershed changes in Java 2 Standard Edition version 5.0 (J2SE 5.0). It provides a thorough, step-by-step approach to threads programming.
Full Description

Threads are essential to Java programming, but learning to use them effectively is a nontrivial task. This new edition of the classic Java Threads shows you how to take full advantage of Java's threading facilities and brings you up-to-date with the watershed changes in Java 2 Standard Edition version 5.0 (J2SE 5.0). It provides a thorough, step-by-step approach to threads programming. Java's threading system is simple relative to other threading systems. In earlier versions of Java, this simplicity came with tradeoffs: some of the advanced features in other threading systems were not available in Java. J2SE 5.0 changes all that: it provides a large number of new thread-related classes that make the task of writing multithreaded programs that much easier. You'll learn where to use threads to increase efficiency, how to use them effectively, and how to avoid common mistakes. This book discusses problems like deadlock, race conditions, and starvation in detail, helping you to write code without hidden bugs. Java Threads, Third Edition, has been thoroughly expanded and revised. It incorporates the concurrency utilities from java.util.concurrent throughout. New chapters cover thread performance, using threads with Swing, threads and Collection classes, thread pools, and threads and I/O (traditional, new, and interrupted). Developers who cannot yet deploy J2SE 5.0 can use thread utilities provided in the Appendix to achieve similar functionality with earlier versions of Java. Topics include:
  • Lock starvation and deadlock detection
  • Atomic classes and minimal synchronization (J2SE 5.0)
  • Interaction of Java threads with Swing, I/O, and Collection classes
  • Programmatically controlled locks and condition variables (J2SE 5.0)
  • Thread performance and security
  • Thread pools (J2SE 5.0)
  • Thread groups
  • Platform-specific thread scheduling
  • Task schedulers (J2SE 5.0)
  • Parallelizing loops for multiprocessor machines
In short, this new edition of Java Threads covers everything you need to know about threads, from the simplest animation program to the most complex applications. If you plan to do any serious work in Java, you will find this book invaluable. Scott Oaks is a senior software engineer for the Java Performance Engineering group at Sun Microsystems and the author of four books in the O'Reilly Java series. Formerly a senior systems engineer at Sun Microsystems, Henry Wong is an independent consultant working on various Java related projects.

Browse within this book

Cover | Table of Contents | Colophon




Featured customer reviews

Write a Review


A must-read,  November 29 2006
Rating: StarStarStarStarStar
Submitted by Bernard   [Respond | View]

I happen not to agree with the previous review, everything is clearly explained in the book. For instance, p40, a lock is explained as:


When a method is declared synchronized, the thread that wants to execute it must acquire a token, which we call a lock (...) Only one thread can grab a lock at a time (...) Upon completion of the method, the lock is automatically released.


Sure, the thread topic is not for beginners, but since every program is going to use threads whether you want it or not, any self-respecting programmer should have a good knowledge of threads.
This book also covers all the new thread-related class of Java 5.0, which is the reason why I bought it.


The Basics Are Missing,  July 30 2005
Rating: StarStarStarStarStar
Submitted by Dave   [Respond | View]

Very poor book. Many essential explanations are missing, possibly due in part to an apparent obsession with race conditions. Although race conditions are a very important topic, and they should be thoroughly covered in a book such as this, many of them can be avoided by knowing the basics, which this book does not explain well.

For instance, look at lock() and unlock(). What is being locked? What is being unlocked? Basic questions, right? We are never really told. Although there is much text devoted to these methods, it is left to the reader to figure out the answer to these questions.

The same is true for wait() and notify(). What is being waited on? Who is being notified? We are never really told, but rather we are left to try to put the descriptions together in a way that makes sense.

There are many other areas of total confusion (including many pages devoted to a "race condition" that apparently does not exist), but the above examples should give you an idea of the caliber of this book.

BTW, I have been in this business for 30+ years.




Read all reviews


See larger cover