You are previewing Parallel Programming with Microsoft® Visual Studio® 2010 Step by Step.
O'Reilly logo
Parallel Programming with Microsoft® Visual Studio® 2010 Step by Step

Book Description

The roadmap for developers wanting to maximize their applications for multi-core architecture using Visual Studio 2010.

Table of Contents

  1. Parallel Programming with Microsoft® Visual Studio® 2010 Step by Step
  2. Dedication
  3. A Note Regarding Supplemental Files
  4. Foreword
  5. Introduction
    1. Who Should Read This Book
    2. Who Should Not Read This Book
      1. Assumptions
    3. Organization of This Book
      1. Finding Your Best Starting Point in This Book
    4. Conventions and Features in This Book
    5. System Requirements
    6. Code Samples
      1. Installing the Code Samples
    7. How to Access Your Online Edition Hosted by Safari
    8. How to Download the Online Edition to Your Computer
    9. Acknowledgments
    10. Errata and Book Support
    11. We Want to Hear from You
    12. Stay in Touch
  6. 1. Introduction to Parallel Programming
    1. Multicore Computing
      1. Multiple Instruction Streams/Multiple Data Streams
      2. Multithreading
      3. Synchronization
    2. Speedup
      1. Amdahl’s Law
      2. Gustafson’s Law
    3. Software Patterns
      1. The Finding Concurrency Pattern
        1. The Task Decomposition Pattern
        2. The Data Decomposition Pattern
        3. The Group Tasks Pattern
        4. The Order Tasks Pattern
        5. The Data Sharing Pattern
      2. The Algorithm Structure Pattern
      3. The Supporting Structures Pattern
    4. Summary
    5. Quick Reference
  7. 2. Task Parallelism
    1. Introduction to Parallel Tasks
      1. Threads
      2. The Task Class
        1. Using the Parallel.Invoke Method
        2. Using the TaskFactory.StartNew method
        3. Using the Task.Start Method
      3. Using Function Delegates
    2. Unhandled Exceptions in Tasks
    3. Sort Examples
      1. Bubble Sort
      2. Insertion Sort
      3. Pivot Sort
      4. Using the Barrier Class
      5. Refactoring the Pivot Sort
    4. Cancellation
      1. A Cancellation Example
    5. Task Relationships
      1. Continuation Tasks
      2. Parent and Child Tasks
      3. The Work-Stealing Queue
    6. Summary
    7. Quick Reference
  8. 3. Data Parallelism
    1. Unrolling Sequential Loops into Parallel Tasks
      1. Evaluating Performance Considerations
      2. The Parallel For Loop
      3. Interrupting a Loop
      4. Handling Exceptions
      5. Dealing with Dependencies
    2. Reduction
    3. Using the MapReduce Pattern
      1. A Word Count Example
    4. Summary
    5. Quick Reference
  9. 4. PLINQ
    1. Introduction to LINQ
      1. PLINQ
    2. PLINQ Operators and Methods
      1. The ForAll Operator
      2. ParallelExecutionMode
      3. WithMergeOptions
      4. AsSequential
      5. AsOrdered
      6. WithDegreeOfParallelism
    3. Handling Exceptions
    4. Cancellation
    5. Reduction
      1. Using MapReduce with PLINQ
    6. Summary
    7. Quick Reference
  10. 5. Concurrent Collections
    1. Concepts of Concurrent Collections
      1. Producer-Consumers
    2. Lower-Level Synchronization
      1. SpinLock
      2. SpinWait
        1. Two-Phase Synchronization
      3. ConcurrentStack
      4. ConcurrentQueue
      5. ConcurrentBag
      6. ConcurrentDictionary
      7. BlockingCollection
    3. Summary
    4. Quick Reference
  11. 6. Customization
    1. Identifying Opportunities for Customization
    2. Custom Producer-Consumer Collections
    3. Task Partitioners
    4. Advanced Custom Partitioners
      1. Using Partitioner<TSource>
      2. Using OrderablePartitioner<TSource>
    5. Custom Schedulers
      1. The Context Scheduler
      2. The Task Scheduler
        1. Using a Custom Task Scheduler
        2. Creating a Custom Scheduler
    6. Summary
    7. Quick Reference
  12. 7. Reports and Debugging
    1. Debugging with Visual Studio 2010
      1. Live Debugging
      2. Performing Post-Mortem Analysis
      3. Debugging Threads
    2. Using the Parallel Tasks Window
    3. Using the Parallel Stacks Window
      1. The Threads View
      2. The Tasks View
    4. Using the Concurrency Visualizer
      1. CPU Utilization View
      2. The Threads View
        1. The Report Section
      3. The Cores View
    5. The Sample Application
    6. Summary
    7. Quick Reference
  13. A. Donis Marshall
  14. Index
  15. About the Author
  16. Copyright