- Shopping Bag ( 0 items )
Posted July 26, 2006
goes beyond official Sun documentation
In Sun's official documentation for Java, there are aids on writing explicit multithreading programs. These are ok, as far as they go. But you might find that in an actual non-trivial, non-textbook case, strange things can happen. Deadlocking. Or perhaps low multicore usages. Or ... This book goes way beyond the Sun documentation. It looks at many aspects of concurrency. Including how to make a thread safe class. Which is one of the basic things you need, given that Java is object oriented, and a typical program makes classes specific to its needs. Here, the guidelines are concise, requiring that you focus on defining the class's invariants and the variables that define the state of the class. The book does not seem to explicitly talk about the concept of a finite state machine. But that is essentially what you might want to consider for each of your classes that will have multithreaded access. Also well worth attention is the chapter on multithread performance. Germane with the increasing availability of multicore processors. The chapter has a lucid explanation of the costs of having too many threads. You need to strive to minimise the maximum number of threads in your application. Context switching can be extremely costly in terms of time, and greatly reduce the overall efficiency.Was this review helpful? Yes NoThank you for your feedback. Report this reviewThank you, this review has been flagged.