Skip to content
Scan a barcode
Scan
Paperback The Idle Thread: Asynchronous Programming in C# and .NET Book

ISBN: B0HHRKHMV7

ISBN13: 9798171394431

The Idle Thread: Asynchronous Programming in C# and .NET

Four seconds of waiting. Eleven milliseconds of work.

That is Skylark in chapter one: a flight-price aggregator that asks three airlines for a fare and holds a thread hostage through almost all of it.

Ten chapters later the same program queries forty carriers inside a two-second budget, streams each price to the browser as it lands, scores fifty thousand itineraries across eight cores, and cancels every outbound call the moment a user closes the tab. At two hundred requests a second its median response time is seventy milliseconds worse than at idle.

One program, rebuilt in the open. Every change comes with a measurement you can reproduce.

Plenty of C# developers type async and await daily and would struggle to say what happens to the calling thread when execution reaches an await, or why a service that looks perfectly healthy quietly stops answering under load. This book replaces pattern matching with a model.


What you'll work throughWhat a thread costs, and the point where adding more of them stops helpingWhat a Task really is, and how a thousand of them run on thirteen threadsWhat the compiler writes when you type await, and how to read the stack traces it leaves behindTask.WhenAll, WhenAny and .NET 9's WhenEach, plus the one small omission that turns a fan-out back into a queueCancellation, linked tokens, timeouts, and returning partial results when the clock runs outWhy .Result deadlocks a WPF app and starves an ASP.NET Core one, and how to recognise starvation from a counters dashboardWhere parallelism is the right tool and async has nothing to offerAsync in a real service: EF Core, IHttpClientFactory, BackgroundService, channels, IAsyncEnumerable streamingValueTask and its four rules, ExecutionContext, and what .NET 11's runtime async changes underneath you

Written for developers who already know C# - generics, LINQ, the shape of a .NET project. No prior multithreading experience assumed; chapter two starts from what a thread is.

Code targets .NET 10 LTS, with a closing chapter on .NET 11. A quick-reference appendix collects the combinators, the cancellation API, the diagnostic commands, and a table of anti-patterns with what to write instead.

Recommended

Format: Paperback

Condition: New

$12.27
Ships within 2-3 days
Save to List

Customer Reviews

0 rating
Copyright © 2026 Thriftbooks.com Terms of Use | Privacy Policy | Do Not Sell/Share My Personal Information | Cookie Notice | Cookie Preferences | Accessibility Statement
ThriftBooks ® and the ThriftBooks ® logo are registered trademarks of Thrift Books Global, LLC
GoDaddy Verified and Secured