Home > Store > Programming > C#

larger cover

Add To My Wish List

Concurrent Programming on Windows

Register your product to gain access to bonus material or receive a coupon.

  • Audio & Video
  • Description
  • Extras
  • Reviews
  • Sample Content
  • Updates

Product Author Bios

Joe Duffy is the development lead, architect, and founder of the Parallel Extensions to the .NET Framework team at Microsoft. In addition to hacking code and managing a team of developers, he works on long-term vision and incubation efforts, such as language and type system support for concurrency safety. He previously worked on the Common Language Runtime team. Joe blogs regularly at www.bluebytesoftware.com/blog.

“When you begin using multi-threading throughout an application, the importance of clean architecture and design is critical. . . . This places an emphasis on understanding not only the platform’s capabilities but also emerging best practices. Joe does a great job interspersing best practices alongside theory throughout his book.”

– From the Foreword by Craig Mundie, Chief Research and Strategy Officer, Microsoft Corporation

 

Author Joe Duffy has risen to the challenge of explaining how to write software that takes full advantage of concurrency and hardware parallelism. In Concurrent Programming on Windows, he explains how to design, implement, and maintain large-scale concurrent programs, primarily using C# and C++ for Windows.

 

Duffy aims to give application, system, and library developers the tools and techniques needed to write efficient, safe code for multicore processors. This is important not only for the kinds of problems where concurrency is inherent and easily exploitable—such as server applications, compute-intensive image manipulation, financial analysis, simulations, and AI algorithms—but also for problems that can be speeded up using parallelism but require more effort—such as math libraries, sort routines, report generation, XML manipulation, and stream processing algorithms.

 

Concurrent Programming on Windows has four major sections: The first introduces concurrency at a high level, followed by a section that focuses on the fundamental platform features, inner workings, and API details. Next, there is a section that describes common patterns, best practices, algorithms, and data structures that emerge while writing concurrent software. The final section covers many of the common system-wide architectural and process concerns of concurrent programming.

 

This is the only book you’ll need in order to learn the best practices and common patterns for programming with concurrency on Windows and .NET.

Author's Site

Author's Web site

Customer Reviews

17 of 17 people found the following review helpful
4.0 out of 5 stars One of the best books on the topic, March 4, 2009
By 
This review is from: Concurrent Programming on Windows (Paperback)
I'll split my review into 3 parts:

Know what you get (book's goals): 4/10. The book is a bit "all over the place". It's hard to understand the intent of the book -- it's a bit too theoretical for a "pragmatic concurrent development" that it claims to be which makes the entire book a bit fuzzy and way too long. The problem with this kind of books that you usually can't read all (reading 800+ pages is too much for most people) and you're afraid of missing important parts.

Coverage: 9/10. This book is a great "ref" book in my bookshelf, it explains high level architecture to very deep bits&bytes usage in a very readable fashion. I've got a list of pages that I recommended every one of our developers to read, starting from basic things and dive into data structures, interesting pitfalls and solutions and specific tips & tricks that I found very interesting during my reading.

Relevance: 10/10. This is a must have book for windows developers (especially for... Read more
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


52 of 62 people found the following review helpful
2.0 out of 5 stars Disappointing, January 26, 2009
This review is from: Concurrent Programming on Windows (Paperback)
I really wanted to like this book, but in the end I couldn't. It seems to me to be at least twice as long as it needs to be, extremely poorly and confusingly written, and a mish-mash of random odds and ends. I don't think the author has really worked out who his target audience is. Is it people who have a serious interest in the logic of concurrent programming - in which case you'd be better off reading the original papers by the likes of Dijkstra and Hoare, or the much much shorter book by Ben-Ari? Or is it aimed at people who want to write concurrent programs that work on Windows? In which case you'd be better off reading the much shorter book by Beveridge and Wiener.
Proof-reading and quality control is shoddy. For example, I have the distinct impression that at some point some-one has done a global replace of "task" with "thread" in the text, resulting in jibber-jabber such as "though it's highly unlikely that anybody reading this book will have to take on such a thread" on... Read more
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


9 of 11 people found the following review helpful
5.0 out of 5 stars Right mix of theory and practice with lots of Win32, Vista, and .Net API Usage examples, December 18, 2008
This review is from: Concurrent Programming on Windows (Paperback)
This book has just the right mix of theory and practical advice to help one learn how to write safe and reliable concurrent applications for the Windows Platform. It is organized into five parts. Part One consists of two introductory chapters on program state management concepts such as synchronization etc. Part Two discusses mechanisms available in the Windows Platform to support concurrent programming: from heavier-weight kernel objects such as Mutexes and Semaphores to lighter-weight and higher-level abstractions such as Monitors, Thread Pools, and Asynchronous Programming Models. Part Three delves into concurrency hazards (e.g., race conditions, deadlocks) to watch out for and data structures (e.g., parallel containers) and techniques that one can use for certain kinds of problems. Part Four culminates in detailed discussions of asynchronous mechanisms for dealing with potentially expensive I/O and GUI operations. Finally, Part Five consists of two appendices: The first... Read more
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


Share your thoughts with other customers:
 See all 15 customer reviews...

Online Sample Chapter

Concurrent Programming on Windows: Synchronization and Time

Sample Pages

Download the sample pages

Table of Contents

Foreword xix

Preface xxiii

Acknowledgments xxvii

About the Author xxix

 

Part I: Concepts 1

 

Chapter 1: Introduction 3

Why Concurrency? 3

Program Architecture and Concurrency 6

Layers of Parallelism 8

Why Not Concurrency? 10

Where Are We? 11

 

Chapter 2: Synchronization and Time 13

Managing Program State 14

Synchronization: Kinds and Techniques 38

Where Are We? 73

 

Part II: Mechanisms 77

 

Chapter 3: Threads 79

Threading from 10,001 Feet 80

The Life and Death of Threads 89

Where Are We? 124

 

Chapter 4: Advanced Threads 127

Thread State 127

Inside Thread Creation and Termination 152

Thread Scheduling 154

Where Are We? 180

 

Chapter 5: Windows Kernel Synchronization 183

The Basics: Signaling and Waiting 184

Using the Kernel Objects 211

Where Are We? 251

 

Chapter 6: Data and Control Synchronization 253

Mutual Exclusion 255

Reader/Writer Locks (RWLs) 287

Condition Variables 304

Where Are We? 312

 

Chapter 7: Thread Pools 315

Thread Pools 101 316

Windows Thread Pools 323

CLR Thread Pool 364

Performance When Using the Thread Pools 391

Where Are We? 398

 

Chapter 8: Asynchronous Programming Models 399

Asynchronous Programming Model (APM) 400

Event-Based Asynchronous Pattern 421

Where Are We? 427

 

Chapter 9: Fibers 429

An Overview of Fibers 430

Using Fibers 435

Additional Fiber-Related Topics 445

Building a User-Mode Scheduler 453

Where Are We? 473

 

Part III: Techniques 475

 

Chapter 10: Memory Models and Lock Freedom 477

Memory Load and Store Reordering 478

Hardware Atomicity 486

Memory Consistency Models 506

Examples of Low-Lock Code 520

Where Are We? 541

 

Chapter 11: Concurrency Hazards 545

Correctness Hazards 546

Liveness Hazards 572

Where Are We? 609

 

Chapter 12: Parallel Containers 613

Fine-Grained Locking 616

Lock Free 632

Coordination Containers 640

Where Are We? 654

 

Chapter 13: Data and Task Parallelism 657

Data Parallelism 659

Task Parallelism 684

Message-Based Parallelism 719

Cross-Cutting Concerns 720

Where Are We? 732

 

Chapter 14: Performance and Scalability 735

Parallel Hardware Architecture 736

Speedup: Parallel vs. Sequential Code 756

Spin Waiting 767

Where Are We? 781

 

Part IV: Systems 783

 

Chapter 15: Input and Output 785

Overlapped I/O 786

I/O Cancellation 822

Where Are We? 826

 

Chapter 16: Graphical User Interfaces 829

GUI Threading Models 830

.NET Asynchronous GUI Features 837

Where Are We? 860

 

Part V: Appendices 863

 

Appendix A: Designing Reusable Libraries for Concurrent .NET Programs 865

The 20,000-Foot View 866

The Details 867

 

Appendix B: Parallel Extensions to .NET 887

Task Parallel Library 888

Parallel LINQ 910

Synchronization Primitives 915

Concurrent Collections 924

 

Index 931

 
Best Value

Book + eBook Bundle  $107.98  $64.79

Book Price $47.99
eBook Price $16.80
eBook formats included

Buy

This book includes free shipping!

Buy

Book  $59.99  $47.99

Usually ships in 24 hours.

This book includes free shipping!

Buy

eBook (Watermarked)  $47.99  $38.39

Includes EPUB, MOBI, and PDF
About eBook Formats

This eBook includes the following formats, accessible from your Account page after purchase:

ePubEPUBThe open industry format known for its reflowable content and usability on supported mobile devices.

MOBIMOBIThe eBook format compatible with the Amazon Kindle and Amazon Kindle applications.

Adobe ReaderPDFThe popular standard, used most often with the free Adobe® Reader® software.

This eBook requires no passwords or activation to read. We customize your eBook by discretely watermarking it with your name, making it uniquely yours.

Purchase Reward: One Month Free Subscription
By completing any purchase on InformIT, you become eligible for an unlimited access one-month subscription to Safari Books Online.

Get access to thousands of books and training videos about technology, professional development and digital media from more than 40 leading publishers, including Addison-Wesley, Prentice Hall, Cisco Press, IBM Press, O'Reilly Media, Wrox, Apress, and many more. If you continue your subscription after your 30-day trial, you can receive 30% off a monthly subscription to the Safari Library for up to 12 months. That's a total savings of $199.