Concurrent programming is fraught with peril. It's much more complex than sequential programming in every meaningful way from specification to unit testing. But if you want to do it right, meaning balancing liveness with safety for efficient and robust multi-threaded applications, you need Doug Lea's "Concurrent Programming in Java". Especially if you need to design an extensible framework with concurrency; well-known examples of such frameworks incluce Swing, most of java.net, and just about every aspect of J2EE.
Lea provides an intense introduction at the level of an advanced undergraduate course. It's fairly academic in tone, because he takes the time to provide thorough definitions and detailed examples. As a former academic who now designs and programs for a living, this is just what I was looking for. But don't buy this book expecting a cookbook of code to cut and paste. It's much more about providing you the fundamental tools to design your own concurrent classes, applications and frameworks.
Lea presupposes the user is fluent in Java, knows a bit about concurrent programming patterns involving mutexes, semaphores, etc, and is familiar with the basic object-oriented design patterns. If you're not up to speed in these areas, the path I followed was reading the following:
* Lewis's "Threads Primer" (warning: it's C/unix-based),
* Gosling and Joy's "Java Programming Language",
* Bloch's "Effective Java", and
* Gamma et al.'s "Design Patterns".
Even if you don't buy this book, consider using Lea's concurrent.util package available from his web site. It provides solid implementations of everything from simple mutexes to concurrent read-single write wrappers for Java collections (Sun's own wrappers simply synchronize all methods, which suffers reduced liveness compared to CRSW designs). And it's both elegantly designed and thoroughly javadoc-ed.
The first edition was great, and I've just finished reading the second edition cover to cover and it has taken my understanding of concurrent design to a new level. Just be warned that this book's not for novices or hobbyists; it's for programmers who need to design the guts of concurrent systems the "right" way and then implement them in Java, especially for extensible frameworks.
Concurrent Programming in Java¿: Design Principles and Pattern (2nd Edition) (英语) 平装
显示所有 格式和版本 隐藏其他格式和版本
|5 星 (0%)||0%|
|4 星 (0%)||0%|
|3 星 (0%)||0%|
|2 星 (0%)||0%|
|1 星 (0%)||0%|
美国亚马逊： 32 条评论
Everything you need to know about concurrency in Java2003年4月12日 - 已在美国亚马逊上发表
Classic book on Java concurrency2019年1月14日 - 已在美国亚马逊上发表
Classic book on Java concurrency.
Great Threaded Programming Information for More than Java2006年1月9日 - 已在美国亚马逊上发表
This is the best book I have ever read on threading, and certainly applies well to other languages naturally (especially languages with a modern and mature thread library like Mono/.NET). Unlike other reviewers here, I encourage so-called "beginners" to read this book. He has plenty of examples so you will not get lost, and this *is* the right way to do things, so start with this one.
Very good and thorough explanation2013年10月7日 - 已在美国亚马逊上发表
The book is very good in explaining the details of Java concurrency model. It is pretty old, but that is good too, because instead of simply describing new solutions, it actually explains why these new solutions were necessary in the first place.
Currently studying concurrency.2016年2月23日 - 已在美国亚马逊上发表
Book is a little dated now but the principles in this book are still sound. Writing is informative and coherent. Would recommend.