|
|
Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
java.lang.Thread and class Object's wait() and notify() methods -- and are supported by the language itself via a single keyword, synchronized, it follows that Java Threads's 250-odd pages explore many a dark multithreaded corner.In this review I'll provide a blow-by-blow account of each of the eight chapters and four appendices, followed by a few miscellaneous items of note for anyone considering purchasing this book.
![]() Java Threads |
Chapter 2, "The Java Threading API," introduces the Thread class and the associated, pivotal Runnable interface. The authors examine the start(), stop(), and sleep() using a simple, multithreaded applet example, and then switch the focus to the join() method, which is used to wait for the completion of some other thread.
At this point, I think it is worth mentioning two things about the examples provided with this book: first, the book does not include a disk (floppy or CD) of source code. My initial response to this discovery was quite positive, figuring I'd just head over to the O'Reilly Web site and pick up whatever I needed; unfortunately, there is no link to such a site. My second gripe is that many of the programs are incomplete (that is, they won't compile because they are not meant to be compilable examples) or hypothetical in nature (where 90 percent of the program is left to the reader's imagination). In short, the examples do not provide insight into the behavior of running threads. Worse, because you cannot check any of the examples, you are sometimes left reading large amounts of text and code "on faith."
Chapter 2 also introduces the threading pitfall par excellence: race conditions. Readers follow along as the authors develop
an AsyncReadSocket class that loses data due to a (purposely) naive lack of protection against multithreaded access of this network programming
class. (Yes, the authors are Unix programmers, so they think nothing of relying on your development platform being permanently
connected to a TCP/IP network, or using some advanced socket programming to make a point about multithreading. To mortals
with dial-up access or novices in the art of TCP/IP programming: tough luck.)