Book description
Expert guidance for those programming today's dual-core processors PCs
As PC processors explode from one or two to now eight processors, there is an urgent need for programmers to master concurrent programming. This book dives deep into the latest technologies available to programmers for creating professional parallel applications using C#, .NET 4, and Visual Studio 2010. The book covers task-based programming, coordination data structures, PLINQ, thread pools, asynchronous programming model, and more. It also teaches other parallel programming techniques, such as SIMD and vectorization.
Teaches programmers professional-level, task-based, parallel programming with C#, .NET 4, and Visual Studio 2010
Covers concurrent collections, coordinated data structures, PLINQ, thread pools, asynchronous programming model, Visual Studio 2010 debugging, and parallel testing and tuning
Explores vectorization, SIMD instructions, and additional parallel libraries
Master the tools and technology you need to develop thread-safe concurrent applications for multi-core systems, with Professional Parallel Programming with C#.
Table of contents
- Copyright
- CREDITS
- ABOUT THE AUTHOR
- ABOUT THE TECHNICAL EDITOR
- ACKNOWLEDGMENTS
- FOREWORD
- INTRODUCTION
-
1. Task-Based Programming
- 1.1. WORKING WITH SHARED-MEMORY MULTICORE
- 1.2. UNDERSTANDING HARDWARE THREADS AND SOFTWARE THREADS
- 1.3. UNDERSTANDING AMDAHL'S LAW
- 1.4. CONSIDERING GUSTAFSON'S LAW
- 1.5. WORKING WITH LIGHTWEIGHT CONCURRENCY
- 1.6. CREATING SUCCESSFUL TASK-BASED DESIGNS
- 1.7. PREPARING FOR NUMA AND HIGHER SCALABILITY
- 1.8. DECIDING THE CONVENIENCE OF GOING PARALLEL
- 1.9. SUMMARY
- 2. Imperative Data Parallelism
-
3. Imperative Task Parallelism
-
3.1. CREATING AND MANAGING TASKS
- 3.1.1. System.Theading.Tasks.Task
- 3.1.2. Understanding a Task's Status and Lifecycle
- 3.1.3. Using Tasks to Parallelize Code
- 3.1.4. Waiting for Tasks to Finish
- 3.1.5. Forgetting About Complex Threads
- 3.1.6. Cancelling Tasks Using Tokens
- 3.1.7. Returning Values from Tasks
- 3.1.8. TaskCreationOptions
- 3.1.9. Chaining Multiple Tasks Using Continuations
- 3.1.10. Preparing the Code for Concurrency and Parallelism
- 3.2. SUMMARY
-
3.1. CREATING AND MANAGING TASKS
-
4. Concurrent Collections
-
4.1. UNDERSTANDING THE FEATURES OFFERED BY CONCURRENT COLLECTIONS
- 4.1.1. System.Collections.Concurrent
- 4.1.2. ConcurrentQueue
- 4.1.3. Understanding a Parallel Producer-Consumer Pattern
- 4.1.4. ConcurrentStack
- 4.1.5. Transforming Arrays and Unsafe Collections into Concurrent Collections
- 4.1.6. ConcurrentBag
- 4.1.7. IProducerConsumerCollection
- 4.1.8. BlockingCollection
- 4.1.9. ConcurrentDictionary
- 4.2. SUMMARY
-
4.1. UNDERSTANDING THE FEATURES OFFERED BY CONCURRENT COLLECTIONS
-
5. Coordination Data Structures
- 5.1. USING CARS AND LANES TO UNDERSTAND THE CONCURRENCY NIGHTMARES
- 5.2. UNDERSTANDING NEW SYNCHRONIZATION MECHANISMS
- 5.3. WORKING WITH SYNCHRONIZATION PRIMITIVES
- 5.4. WORKING WITH MUTUAL-EXCLUSION LOCKS
- 5.5. USING SPIN LOCKS AS MUTUAL-EXCLUSION LOCK PRIMITIVES
- 5.6. WORKING WITH LIGHTWEIGHT MANUAL RESET EVENTS
- 5.7. LIMITING CONCURRENCY TO ACCESS A RESOURCE
- 5.8. SIMPLIFYING DYNAMIC FORK AND JOIN SCENARIOS WITH COUNTDOWNEVENT
- 5.9. WORKING WITH ATOMIC OPERATIONS
- 5.10. SUMMARY
-
6. PLINQ: Declarative Data Parallelism
- 6.1. TRANSFORMING LINQ INTO PLINQ
- 6.2. SPECIFYING THE EXECUTION MODE
- 6.3. UNDERSTANDING PARTITIONING IN PLINQ
- 6.4. PERFORMING REDUCTION OPERATIONS WITH PLINQ
- 6.5. CREATING CUSTOM PLINQ AGGREGATE FUNCTIONS
- 6.6. CONCURRENT PLINQ TASKS
- 6.7. CANCELLING PLINQ
- 6.8. SPECIFYING THE DESIRED DEGREE OF PARALLELISM
- 6.9. WORKING WITH FORALL
- 6.10. CONFIGURING HOW RESULTS ARE RETURNED BY USING WITHMERGEOPTIONS
- 6.11. HANDLING EXCEPTIONS THROWN BY PLINQ
- 6.12. USING PLINQ TO EXECUTE MAPREDUCE ALGORITHMS
- 6.13. DESIGNING SERIAL STAGES USING PLINQ
- 6.14. SUMMARY
- 7. Visual Studio 2010 Task Debugging Capabilities
-
8. Thread Pools
- 8.1. GOING DOWNSTAIRS FROM THE TASKS FLOOR
-
8.2. UNDERSTANDING THE NEW CLR 4 THREAD POOL ENGINE
- 8.2.1. Understanding Global Queues
- 8.2.2. Waiting for Worker Threads to Finish Their Work
- 8.2.3. Tracking a Dynamic Number of Worker Threads
- 8.2.4. Using Tasks Instead of Threads to Queue Jobs
- 8.2.5. Understanding the Relationship Between Tasks and the Thread Pool
- 8.2.6. Understanding Local Queues and the Work-Stealing Algorithm
- 8.2.7. Specifying a Custom Task Scheduler
- 8.3. SUMMARY
-
9. Asynchronous Programming Model
-
9.1. MIXING ASYNCHRONOUS PROGRAMMING WITH TASKS
- 9.1.1. Working with TaskFactory.FromAsync
- 9.1.2. Programming Continuations After Asynchronous Methods End
- 9.1.3. Combining Results from Multiple Concurrent Asynchronous Operations
- 9.1.4. Performing Asynchronous WPF UI Updates
- 9.1.5. Performing Asynchronous Windows Forms UI Updates
- 9.1.6. Creating Tasks that Perform EAP Operations
- 9.1.7. Working with TaskCompletionSource
- 9.2. SUMMARY
-
9.1. MIXING ASYNCHRONOUS PROGRAMMING WITH TASKS
-
10. Parallel Testing and Tuning
- 10.1. PREPARING PARALLEL TESTS
-
10.2. SOLUTIONS TO COMMON PATTERNS
- 10.2.1. Serialized Execution
- 10.2.2. Lock Contention
- 10.2.3. Lock Convoys
- 10.2.4. Oversubscription
- 10.2.5. Undersubscription
- 10.2.6. Partitioning Problems
- 10.2.7. Workstation Garbage-Collection Overhead
- 10.2.8. Working with the Server Garbage Collector
- 10.2.9. I/O Bottlenecks
- 10.2.10. Main Thread Overload
- 10.3. UNDERSTANDING FALSE SHARING
- 10.4. SUMMARY
- 11. Vectorization, SIMD Instructions, and Additional Parallel Libraries
- A. .NET 4 Parallelism Class Diagrams
- B. Concurrent UML Models
- C. Parallel Extensions Extras
Product information
- Title: Professional Parallel Programming with C#: Master Parallel Extensions With .NET 4
- Author(s):
- Release date: December 2010
- Publisher(s): Wrox
- ISBN: 9780470495995
You might also like
video
Hands-On Parallel Programming with C# 8 and .NET Core 3.0
With the new industry standard of increasing the processing power of machines, the concept of parallel …
book
Hands-On Parallel Programming with C# 8 and .NET Core 3
Enhance your enterprise application development skills by mastering parallel programming techniques in .NET and C# Key …
book
Pro Asynchronous Programming with .NET
Pro Asynchronous Programming with .NET teaches the essential skill of asynchronous programming in .NET. It answers …
book
Pro C# 7: With .NET and .NET Core
This essential classic title provides a comprehensive foundation in the C# programming language and the frameworks …