C#idiomatic C#
async-and-concurrency105 pages

idiomatic C#

Async and concurrency

async and await, tasks, dataflow, and the rules for running work in parallel.

  1. Async return types 11/22/2024
  2. Asynchronous programming scenarios 03/12/2025
  3. Cancel a list of tasks 02/09/2023
  4. Cancel async tasks after a period of time 02/09/2023
  5. Tutorial: Generate and consume async streams using C# and .NET 11/01/2022
  6. Asynchronous programming with async and await 03/10/2025
  7. Process asynchronous tasks as they complete 02/08/2023
  8. Task asynchronous programming model 10/13/2025
  9. Asynchronous file access 04/22/2026
  10. Attached and Detached Child Tasks 03/30/2017
  11. Chaining tasks using continuation tasks 10/20/2025
  12. Custom Partitioners for PLINQ and TPL 03/30/2017
  13. Data Parallelism (Task Parallel Library) 03/30/2017
  14. Data Structures for Parallel Programming 03/30/2017
  15. Dataflow (Task Parallel Library) 10/22/2025
  16. Exception handling (Task Parallel Library) 06/08/2022
  17. For Further Reading (Parallel Programming) 04/26/2018
  18. How to: Cancel a Dataflow Block 03/30/2017
  19. How to: Cancel a Parallel.For or ForEach Loop 08/18/2023
  20. How to: Cancel a PLINQ Query 03/30/2017
  21. How to: Cancel a Task and Its Children 04/09/2024
  22. How to: Combine Parallel and Sequential LINQ Queries 03/30/2017
  23. How to: Control Ordering in a PLINQ Query 03/30/2017
  24. How to: Create and Execute a Simple PLINQ Query 03/30/2017
  25. Create pre-computed tasks 05/04/2021
  26. How to: Handle Exceptions in a PLINQ Query 03/30/2017
  27. How to: Handle Exceptions in Parallel Loops 03/30/2017
  28. How to: Implement a Partitioner for Static Partitioning 03/30/2017
  29. How to: Implement a producer-consumer dataflow pattern 09/24/2020
  30. How to: Implement Dynamic Partitions 03/30/2017
  31. How to: Iterate File Directories with PLINQ 03/30/2017
  32. How to: Iterate File Directories with the Parallel Class 03/30/2017
  33. How to: Measure PLINQ Query Performance 03/30/2017
  34. How to: Perform Action When a Dataflow Block Receives Data 03/30/2017
  35. How to: Prevent a Child Task from Attaching to its Parent 03/30/2017
  36. How to: Return a Value from a Task 08/10/2022
  37. How to: Specify a Task Scheduler in a Dataflow Block 03/30/2017
  38. How to: Specify Merge Options in PLINQ 03/30/2017
  39. How to: Specify the Degree of Parallelism in a Dataflow Block 03/30/2017
  40. How to: Specify the Execution Mode in PLINQ 03/30/2017
  41. How to: Speed Up Small Loop Bodies 03/30/2017
  42. How to: Traverse a Binary Tree with Parallel Tasks 03/30/2017
  43. How to: Unlink Dataflow Blocks 03/30/2017
  44. How to: Unwrap a Nested Task 03/30/2017
  45. How to: Use JoinBlock to Read Data From Multiple Sources 03/30/2017
  46. How to: Use Parallel.Invoke to Execute Parallel Operations 03/30/2017
  47. How to: Wrap EAP Patterns in a Task 03/30/2017
  48. How to: Write a Custom PLINQ Aggregate Function 03/30/2017
  49. How to: Write a Parallel.For Loop with Thread-Local Variables 05/22/2023
  50. How to: Write a Parallel.ForEach loop with partition-local variables 06/26/2018
  51. How to: Write a Simple Parallel.For Loop 07/16/2021
  52. How to: Write a simple Parallel.ForEach loop 08/13/2024
  53. How to: Write and read messages from a Dataflow block 09/10/2020
  54. Parallel programming in .NET: A guide to the documentation 10/20/2025
  55. Introduction to PLINQ 03/30/2017
  56. Lambda Expressions in PLINQ and TPL 03/30/2017
  57. Merge Options in PLINQ 03/30/2017
  58. Order Preservation in PLINQ 03/30/2017
  59. Parallel Diagnostic Tools 03/30/2017
  60. PLINQ Data Sample 03/30/2017
  61. Potential Pitfalls in Data and Task Parallelism 03/30/2017
  62. Potential pitfalls with PLINQ 03/04/2026
  63. Task-based asynchronous programming 10/22/2025
  64. Task cancellation 10/20/2025
  65. Task Parallel Library (TPL) 10/22/2025
  66. TPL and traditional .NET asynchronous programming 03/30/2017
  67. Speedup in PLINQ 03/30/2017
  68. Walkthrough: Creating a Custom Dataflow Block Type 03/30/2017
  69. Walkthrough: Creating a Dataflow Pipeline 03/30/2017
  70. Walkthrough: Using BatchBlock and BatchedJoinBlock to Improve Efficiency 03/30/2017
  71. Walkthrough: Using Dataflow in a Windows Forms Application 03/30/2017
  72. Barrier 09/14/2018
  73. Canceling threads cooperatively 03/30/2017
  74. Cancellation in Managed Threads 03/17/2026
  75. CountdownEvent 03/30/2017
  76. Create threads and pass data at start time 03/30/2017
  77. Destroy threads 03/13/2026
  78. EventWaitHandle 03/30/2017
  79. Exceptions in managed threads 03/13/2026
  80. Foreground and background threads 03/30/2017
  81. How to: Enable Thread-Tracking Mode in SpinLock 03/30/2017
  82. How to: Listen for Cancellation Requests by Polling 03/30/2017
  83. How to: Listen for Cancellation Requests That Have Wait Handles 03/30/2017
  84. How to: Listen for Multiple Cancellation Requests 03/30/2017
  85. Register callbacks for cancellation requests 08/14/2020
  86. How to: Synchronize Concurrent Operations with a Barrier 03/30/2017
  87. How to: use SpinLock for low-level synchronization 03/30/2017
  88. How to: Use SpinWait to Implement a Two-Phase Wait Operation 03/30/2017
  89. Managed and unmanaged threading in Windows 03/13/2026
  90. Managed threading basics 08/06/2026
  91. Managed threading best practices 03/13/2026
  92. Mutexes 07/19/2021
  93. Overview of synchronization primitives 10/01/2018
  94. Pausing and interrupting threads 03/13/2026
  95. Scheduling threads 03/30/2017
  96. Semaphore and SemaphoreSlim 03/12/2026
  97. SpinLock 03/30/2017
  98. SpinWait 03/30/2017
  99. Synchronizing data for multithreading 03/30/2017
  100. The managed thread pool 03/13/2026
  101. Thread Local Storage: Thread-Relative Static Fields and Data Slots 03/30/2017
  102. Threading objects and features 10/01/2018
  103. Threads and threading 11/08/2018
  104. Timers 07/03/2018
  105. Using threads and threading 03/13/2026