Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
Java threads and the concurrency utilities
Friesen J., Apress, Berkeley, CA, 2015. 200 pp. Type: Book (978-1-484216-99-6)
Date Reviewed: Oct 7 2016

Concurrency is one of the most intrinsic aspects in computer programming and programming languages; Java is not an exception. Handling concurrent threads properly and efficiently requires not only a complete understanding of the problem or context, but also an accurate grasp of the facilities provided in the programming language. This book does a good job in presenting those facilities in Java, from basic to advanced.

Earlier versions of Java provided only rudimentary support for concurrency, including thread/runnable and the synchronized and wait/notify mechanism. Over time, more and more sophisticated facilities and frameworks have been added. In addition to the inherent concurrency support in the object and thread classes in the core java.lang package, the latest Java 8 now includes three additional packages for concurrency utilities (java.util.concurrency and its two subpackages). These packages mainly include the general executor framework for concurrent task and resource modeling, scheduling, and communication; frameworks for different synchronization scenarios; the more versatile lock framework (compared to the code block-based synchronized and wait/notify mechanism); and various ready-to-use, concurrency-friendly data structures.

This book covers all of these topics, with Part 1 on basic concurrency support in Java and Part 2 on more advanced facilities. The coverage is quite comprehensive while the language remains succinct, making the book a very nice read. At numerous places, the book also includes brief definitions of concepts and introductions to common approaches in the context of concurrency, which I think will help readers obtain the big picture of concurrency problems. The exercises at the end of each chapter are a good way to help readers examine their understanding and summarize the covered topics in the chapter. And yes, answers to the exercises are included in the book! To sweeten the deal, this book discusses related concurrency issues in Swing, the classic, lightweight graphical interface in Java, in the appendix. To me, a good understanding of how Swing (or at least its threading model) works behind the scenes is a necessity when one builds Java programs with a non-trivial graphical interface. This need would be even more acute when other parts of the program involve concurrency. I have personally seen many cases where threads handling application logic and the Swing thread intervene with each other, leading to subtle abnormalities and crashes. The additional appendix chapter on Swing will be very helpful in preventing potential bugs and alleviating pain.

Overall, this high-quality book is suitable for any professional Java developer. There are certainly improvements that could be made. First, the textual depiction of scenarios in the book may be too abstract for some readers. Some sort of graphical diagrams could have been more effective in illustrating the scenarios. Second, it would be more desirable to explicitly note the compatibility of every single piece of code in the book. Java has evolved over many years, and the concurrency facilities were added over time. It would be good to state explicitly which version of Java supports a certain piece of code or a facility; a dedicated section on the evolution of concurrency support in Java would fulfill the need as well. Finally, there are other aspects like Swing in Java where concurrency can be relevant, for example, Java nonblocking I/O (NIO) versus regular blocking I/O. In many cases, the decision on which style of I/O to use hinges upon the concurrency structure of the Java application. And a natural follow-up to the concurrency model in Swing is how concurrency is handled in JavaFX, which is intended to replace Swing as the standard graphical user interface (GUI) library in Java.

Reviewer:  Jinzhong Niu Review #: CR144822 (1701-0009)
Bookmark and Share
 
Concurrent Programming (D.1.3 )
 
 
Java (D.3.2 ... )
 
 
Parallelism And Concurrency (F.1.2 ... )
 
 
Language Classifications (D.3.2 )
 
 
Modes Of Computation (F.1.2 )
 
Would you recommend this review?
yes
no
Other reviews under "Concurrent Programming": Date

Type: Journal
Jul 1 1985
Resources in parallel and concurrent systems
, ACM Press, New York, NY, 1991. Type: Book (9780897914000)
Jun 1 1992
Concurrent programming
Andrews G., Benjamin-Cummings Publ. Co., Inc., Redwood City, CA, 1991. Type: Book (9780805300864)
Jun 1 1994
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy