Java Threads

By Henry Wong, Scott Oaks
January 1900
Pages: 268
ISBN 10: 1-56592-216-6 | ISBN 13: 9781565922167

This book has been updated—the edition you're requesting is OUT OF PRINT. Please visit the catalog page of the latest edition.

The latest edition is also available on Safari Books Online.

Book description

With this book, you'll learn 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 like deadlock and race conditions. Covers Java 1.1.
Full Description

Threads aren't a new idea: many operating systems and languages support them. But despite widespread support, threads tend to be something that everyone talks about, but few use. Programming with threads has a reputation for being tricky and nonportable. Not so with Java. Java's thread facilities are easy to use, and -- like everything else in Java -- are completely portable between platforms. And that's a good thing, because it's impossible to write anything but the simplest applet without encountering threads. If you want to work with Java, you have to learn about threads. This book 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. There is thorough coverage of the Thread and ThreadGroup classes, the Runnable interface, and the language's synchronized operator. Java Threads discusses problems like deadlock, race condition, and starvation in detail, helping you to write code without hidden bugs. In addition, Java Threads shows you how to extend Java's thread primitives. A thorough discussion of thread scheduling ends by developing a CPUSchedule class that shows you how to implement your own scheduling policy. Other extended examples include classes that implement reader/writer locks, general locks, locks at arbitrary scope, and asynchronous I/O. In short, Java Threads covers everything you need to know about threads, from the simplest animation applet to the most complex applications. If you plan to do any serious work in Java, you will find this book invaluable. Examples available online. Covers Java 1.1.

Browse within this book

Cover | Table of Contents | Index




Featured customer reviews

Be the first person to review this book!

Write a Review


Media reviews "Please note, the book is not a Java programming handbook. The authors make an assumption that you can write simple Java programs with Java Development Kit. Java Threads deals with one of the features of the Java programming language that is most attractive for professional software developers - threads.

"It is well known that the concept of threads is not a new one: most modern operating systems provide programmers a mechanism to create threads. Threaded programming is essential to Java: many features of threaded system are built into the Java language itself. Threading is an integral part of using Java. Java's threaded system is simple, at least relative to other threading systems. This relative simplicity of Java's threading system makes it easy to learn, so even developers who have no experience in threaded programming at all can use threads with just little effort. However, some of advanced features that are present in other threading systems are not found in Java. Fortunately, theses features can be built by the Java developer from the base constructs which Java provides.

"The theme of the book is: how to use the basic thread features in Java, and how to extend them to perform more advanced tasks for more complex programs. The first several chapters of the book introduce the concept of threads and simple Java API that allows the programmer to create threads. A separate chapter provides the reader with a lot of various examples that show using of threads in practice. Furher chapters cover more andvanced topics as synchronization mechanism, preventing deadlocks, Java sheduling model, thread groups and much more.

Read all reviews

See larger cover