.NET Blog

Free. Cross-platform. Open source. A developer platform for building all your apps.

Async ValueTask Pooling in .NET 5

The async/await feature in C# has revolutionized how developers targeting .NET write asynchronous code. Sprinkle some async and await around, change some return types to be tasks, and badda bing badda boom, you've got an asynchronous implementation. In theory. In practice, obviously I've exaggerated the ease with which a codebase can be made ...

ConfigureAwait FAQ

.NET added async/await to the languages and libraries over seven years ago. In that time, it's caught on like wildfire, not only across the .NET ecosystem, but also being replicated in a myriad of other languages and frameworks. It's also seen a ton of improvements in .NET, in terms of additional language constructs that utilize asynchrony, ...

An Introduction to System.Threading.Channels

"Producer/consumer" problems are everywhere, in all facets of our lives. A line cook at a fast food restaurant, slicing tomatoes that are handed off to another cook to assemble a burger, which is handed off to a register worker to fulfill your order, which you happily gobble down. Postal drivers delivering mail all along their routes, and you ...

GC Perf Infrastructure – Part 1

We open sourced our new GC Perf Infrastructure! It’s now part of the dotnet performance repo. I’ve been meaning to write about it ‘cause some curious minds had been asking when they could use it after I blogged about it last time but didn’t get around to it till now. First of all, let me point out that the target audience of this ...

GC Perf Infrastructure – Part 0

In this blog entry and some future ones I will be showing off functionalities that our new GC perf infrastructure provides. Andy and I have been working on it (he did all the work; I merely played the consultant role). We will be open sourcing it soon and I wanted to give you some examples of using it and you can add these to your repertoire ...

Hardware Intrinsics in .NET Core

Several years ago, we decided that it was time to support SIMD code in .NET. We introduced the System.Numerics namespace with Vector2, Vector3, Vector4, Vector<T>, and related types. These types expose a general-purpose API for creating, accessing, and operating on them using hardware vector instructions (when available). They also ...

Making CPU configuration better for GC on machines with > 64 CPUs

If you are running Windows on a machine with > 64 CPUs, you’ll need to use this feature called the CPU groups for your process to be able to use more than 64 CPUs. At some point in the far distant past, people thought having more than 64 processors on a machine was inconceivable so they used a 64-bit number for the processor mask. And when ...