Concurrency in C# (.NET): Asynchronous and Parallel Programming
300 pages
English
PDF
4.5

Concurrency in C# (.NET): Asynchronous and Parallel Programming

Concurrency in C# (.NET): Asynchronous and Parallel Programming

Author:

Year:

Summary:

Modern applications require high performance and responsiveness. The book "Concurrency in C# (.NET)" is a comprehensive guide to asynchronous, parallel, and multithreaded programming on the .NET platform. You will learn to write efficient, safe, and scalable code that fully leverages the capabilities of modern multi-core processors.



What is this book about?

The book covers all key aspects of concurrent programming in C#:

  • Fundamentals of Multithreading: creating and managing threads, thread pools, synchronization.
  • Asynchronous Programming with async/await: deep dive into the task model, synchronization context, error handling, and operation cancellation.
  • Task Parallel Library (TPL): parallel loops (Parallel.For/ForEach), tasks (Task), result aggregation.
  • Synchronization and Locks: lock, Monitor, Semaphore, Mutex, ReaderWriterLockSlim, as well as modern primitives (Barrier, CountdownEvent).
  • Parallel Collections: ConcurrentDictionary, ConcurrentQueue, BlockingCollection and their usage.
  • Concurrency Patterns: Producer-Consumer, Pipeline, MapReduce, Actor-like models.
  • Debugging and Profiling: tools for finding deadlocks, race conditions, and resource leaks.


Who is this book for?

The book is intended for .NET developers of any level who want to:

  • Understand how asynchrony works under the hood.
  • Avoid common mistakes (deadlock, race condition, thread starvation).
  • Increase the performance of their applications.
  • Master modern approaches to concurrency in .NET 8/9.

A basic knowledge of C# and .NET is sufficient for reading. All concepts are explained from simple to complex with many practical examples.



What will you learn?

  • How to correctly use async/await in web applications, desktop applications, and services.
  • The difference between asynchrony and parallelism.
  • How to design thread-safe classes.
  • How to efficiently work with I/O-bound and CPU-bound operations.
  • How to use Channels for data transfer between threads.
  • How to apply Reactive Extensions (Rx.NET) for complex asynchronous scenarios.


The book contains over 50 practical examples, ready for use in real projects. You will get not only theory but also proven recipes for solving everyday tasks.



Master concurrency in C# and make your applications faster, more reliable, and more scalable!

Recommendations