English
Topic 5. Task parallelism: TPL, cancellation, and exception handling; asynchronous programming with async/await
Goal: become familiar with the Task Parallel Library (TPL) and the .NET async/await asynchronous programming model; learn to start and combine tasks, build task graphs with continuations, handle AggregateException exceptions, cancel operations using tokens and timeouts, and report progress; master asynchronous streams, TaskCompletionSource, and limits on concurrent asynchronous operations.
Lecture contents
- Tasks, states, and continuations — From threads to tasks · Task states and waiting · Continuations and task graphs
- Exceptions, cancellation, and timeouts — Exception handling · Cooperative cancellation · Progress and timeouts
- The async/await model — The async/await model · ValueTask, asynchronous streams, and PeriodicTimer · TaskCompletionSource<T>: turning events into tasks
- Limits, antipatterns, and debugging — Limiting concurrent operations · Asynchronous code antipatterns · Debugging tasks in Rider
- Examples and common mistakes — Program examples · Common mistakes