Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Channels ▼
RSS

Book Review: Concurrent Programming on Windows


Concurrent Programming on Windows
Joe Duffy
Addison-Wesley, 2008
1008 pp., $49.99 ISBN: 978-0-321-43482-1


Let me get straight to the point -- anyone interested in parallel programming using the .NET Framework needs Joe Duffy's Concurrent Programming on Windows. It is the definitive work on the subject, written with great accuracy, clarity and an enthusiastic cadence that will prepare the reader for concurrent computing tasks. Duffy is one of the definitive experts on the topic, considering he was the progenitor of Parallel Language Integrated Query (PLINQ) which eventually morphed into the Parallel Extensions to the .NET Framework. While some of the book's source inspiration is from Joe's own weblog as well as some of his articles published in MSDN Magazine, a majority of the content was written and organized specifically to make learning concurrent programming on the Windows platform as painless and intuitive as possible. Duffy has indubitably succeeded with this herculean task.

Each of the 16 chapters are written more as essays rather than step-by-step tutorials. Taking this approach actually improved my retention of the material, as the author has a talent for describing such technical details in a digestible way. While there are occasional bold type keywords emphasized in these write-ups, there are no call-out boxes or tips written in six-point type along the margins. Some may bemoan the lack of such learning aids, but I found their absence kept me in the flow of the author's explanations and written voice. Plenty of code snippets help reinforce the ideas being asserted, but the book thankfully spends more ink on describing the processes and the reasons behind the technical approaches being advised versus having readers rely on reams of code listings to decipher the nuances of concurrency behind the code. In fact, this would be one of the few programming books that could actually make the cross media leap to an audio book format and survive with nearly all the key ideas and teachings intact.

Part I features two brief chapters setting the concurrent programming stage with the basic concepts of parallelism, state machines and coordinating data synchronization. Part II ("Mechanisms:) accounts for nearly half the book's weight and encompasses seven chapters covering threads and thread pools, kernel object, data and control synchronization, Asynchronous Programming Models (APMs), and the idea and utilization of fibers (a lightweight, cooperative scheduling thread-like mechanism that can reduce the cost of context switching; however, as of the .NET Framework 3.5 release, fibers remains exclusively accessible to Windows C++ developers). Part III contains five chapters centered around concurrent techniques such as memory consistency models, hardware atomicity, low-locks and deadlocks, priority inversion and starvation, general purpose lock-free FIFO queues, data and message-based parallelism and finally touching on the topic of performance and scalability as they apply to parallel hardware architectures, profiling in Visual Studio, garbage collection, and a discussion of Amdahl's Law ("the ability of a parallel algorithm to exhibit speedup over its sequential counterpart is inherently limited by the remaining sequential parts after parallelization") and Mellor-Crummey-Scott (MCS) Locks. The last section of the book on Systems covers overlapped, asynchronous and synchronous I/O thread cancellation, Single Threaded Apartment (STA) GUI threading models and .NET asynchronous GUI features, highlighting the BackgroundWorker package. The appendix contains two sections, one that lists 37 useful tips on designing reusable libraries for concurrent .NET programs (including obvious ones like "avoid blocking while you hold a lock" and not so obvious such as "consider using spin locks for high traffic leaf-level regions of code"), and the other providing an overview of the pieces that comprise the Parallel Extensions to .NET (based on the June 2008 Community Technology Preview) which includes the Task Parallel Library (TPL), Parallel Language Integrated Query (PLINQ) query provider and the various synchronous primitives and set of concurrent collections that are part of this package.

Whether you're a C++ or C# developer seeking the most comprehensive and enriching educational experience on the subject of parallel programming in the Windows environment, Concurrent Programming on Windows is a must have book. Much like Charles Petzold's highly regarded Programming Windows, Joe Duffy's book should have the honor of sitting on the same bookshelf as that essential tome, at least until the commercial computing world makes the full leap into parallel programming and such topics are as standard in future programming books as objects and threads are today.


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.