Java Thread 2nd Edition O'REILLY


Java Threads, Second Edition

By Scott Oaks and Henry Wong




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.

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 new edition 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. Java Threads discusses problems like deadlock, race condition, and starvation in detail, helping you to write code without hidden bugs. It brings you up to date with the latest changes in the thread interface for JDK 1.2. The book offers a thorough discussion of the Thread and ThreadGroup classes, the Runnable interface, the language's synchronized operator. It explains thread scheduling ends by developing a CPUSchedule class, showing you how to implement your own scheduling policy. In addition, Java Threads shows you how to extend Java's thread primitives. Other extended examples include classes that implement reader/writer locks, general locks, locks at arbitrary scope, and asynchronous I/O. This edition also adds extensive examples on thread pools, advanced synchronization technique, like condition variables, barriers, and daemon locks. It shows how to work with classes that are not thread safe, and pays special attention to threading issues with Swing. A new chapter shows you how to write parallel code for multiprocessor machines. 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 2.

Media reviews

"If you are new to Java programming and have yet to conquer threads, Java Threads is an excellent resource. You'll get a look into the basics of Java threading, and learn the techniques necessary to get your programs to function properly in a multithreaded world. Five stars" --John Zukowski, Java World, 03/2001

"This is a good book, and certainly, if you're using threads in Java non-trivially then you should have this book. Otherwise, borrow a copy and read the first half to make yourself aware of the threading issues in Java. Even better, think how your code affects others; the section on mixing threads with thread unsafe classes should make you aware of the wider issues surrounding your code, and hopefully, you'll produce well behaved classes that will be easily multi- threaded if the need arises? Do you use the collections? Think hard..."1999 --Steve Cornish, C Vu, September 1999

"A very useful well-written reference suitable for Java systems developers and as a second level text for students on computing science and IT oriented courses. Highly recommended!" --Brian Bamer, C Vu January 1998



January 1999
Pages: 336
ISBN 10: 1-56592-418-5 | ISBN 13: 9781565924185

Click Here to Download

0 comments:

Post a Comment