C++ Concurrency (英语) 平装 – 2012年2月28日
Anthony Williams is a UK-based developer and consultant with many years experience in C++. He has been an active member of the BSI C++ Standards Panel since 2001, and is author or coauthor of many of the C++ Standards Committee papers leading up to the inclusion of the thread library in the upcoming C++ Standard (known as C++0x). He has been the maintainer of the Boost Thread library since 2006, and is the developer of the just::thread implementation of the C++0x thread library from Just Software Solutions Ltd. Anthony lives in the far west of Cornwall, England.
This book is a mixture of "tutorial" and "reference" manual as in:
The author sometimes introduces items before they are explained so you may have to skip around a bit to work through the discussions.
This is NOT a book to learn about C++11.
You will have to navigate a fair number of those new C++11 features in this book. This can be distracting but probably should be expected since this is part of the whole C++11 package.
Overall this is a useful reference book. I haven't found another book on the subject to compare it to. For the time being I give it 4 stars.
In the second edition we expect:
1) a greater number of solved algorithms, focused on real cases, such as image processing and scientific applications (numerical methods, solvers, EDOs). If possible with charts comparing processing times for different solutions.
2) A chapter dealing with details related to the use of threads in the GNU compiler would be very welcome!
Here are the things I liked most about this book: 1) it thoroughly uses C++11 features, including std::move, etc. 2) it's comphrehensive coverage of threading; and 3) it includes code and design discussion for a complete thread pool.
In my opinion there are only a few shortcomings: 1) The discussions of packaged_task, promise, spinlock, and fences/barries wasn't elaborate enough to help me really learn when/where to use these tools. Futures and async were covered thoroughly, but not these other topics. There was comment about spinlock unblocking the current thread that I didn't understand.
2) There are many places where the author/editor could have tied more narrative to the bullets in the code. That's a nifty feature of this book series, and it worked very well in this book, except that in some places it should have been done more. A couple of tricky lines of code had no comment, e.g. how the handle() function works in the message passing example. The chaining syntax is unusual and needs more explanation.
3) spinlock, and a few other topics, are not in the index.
4) It would be very helpful to see a brief example program that would report the relative performance of an analogous data structure class from the lock-based chapter vs. the lock-free chapter. This would give the reader a glimpse as to when the added complexity pays off.
I will keep this book for a long time :-)
Sometimes obvious things are devoted to quite a bit of volume, but some unclear things are just skipped over.
100+ pages of the book are just C++ Threads library reference, which is available on-line, so including it in the book is questionable.
However, the information presented is done so a bit dry for my tastes. Because of this it has been a great book for my late night reading because I still learn a few concepts and then start finding myself getting drowsy and ready for sleep. It may need less rambling as one reviewer had mentioned. I did agree some paragraphs actually made me re-read because it didn't flow as smoothly, however the writing isn't necessarily bad. I think the author is trying to give a LOT of information and sometimes it bounces around a bit much.
So far I have been able to get what I wanted to get out of the book.