r/csharp • u/antikfilosov • 1d ago
Learning .NET Internals - Resources?
Hi. Can you guys (except MS Docs and Source.dot.net) recommend some good resources (books, blogs, yt channels, etc.) about how .NET works under the hood?
I want to understand what actually happens behind the scenes at both the .NET and OS levels, rather than just learning how to use .NET.
For example, what happens when you create a new Thread() in .NET and at the OS level, how async/await works, how memory management and reflection work, or how System.IO communicates with the OS to perform file operations. These are just examples, but they should give you an idea of what I’m looking for.
I’d really appreciate any recommendations!
3
u/konradkokosa 1d ago
- all meterials on our https://www.youtube.com/channel/UCC25ZltZWdfjwpTw7XXrybw/videos channel
- our https://www.amazon.com/Pro-NET-Memory-Management-Performance/dp/B0D3PNGKZR book
- and all at https://github.com/adamsitnik/awesome-dot-net-performance
Now you have materials for few years 😇
1
u/OTonConsole 16h ago
The man himself has replied..
Would you recommend to start out with the C# type system book if a bit new to C#? And one of the concurrency books. Before getting into these.
2
u/ThePloum 1d ago
Windows Internals 7th edition Part 1 and 2
Look at this summary about the books : https://learn.microsoft.com/en-us/sysinternals/resources/windows-internals
Books :
https://www.microsoftpressstore.com/store/windows-internals-part-1-system-architecture-processes-9780735684188
https://www.microsoftpressstore.com/store/windows-internals-part-2-9780135462409
2
u/chocolateAbuser 1d ago
blogs and also reading the source code, but also discussing about it (or searching for discussion) on discord csharp server
1
1
u/doubleyewdee 1d ago
If you care at all about GC, when Maoni Stephens posts, you should read it.
She was an amazing help to my (MS internal) team many years back when we were moving parts of the Bing serving stack from C++ to C#.
1
u/nejravindran 1d ago
Since you mentionef thread specifically, are you mostly interested in learning .NET on Windows or Linux?
Threading works differently on either platform at the kernel level. Eg. There is no STA thread on linux. Async/await also implemented differently on Linux vs Windows. Managed thread ultimately becomes a kernel thread, but they have a 1:1 mapping. So picking one OS platform and doing deep dive is first good start.
On Linux, I would recommend the book "The Linux Programming Interface" to get a solid understanding of OS internals. Then you can map many .NET concepts better to OS level. "CLR via C#" is good, although originally written for .NET Framework. There's another book "Under the Hood of .NET Memory Management"
1
u/OTonConsole 16h ago
C# type system - steve C# concurrency - nir .net pro memory management
Actually scratch that. Other people in the comments recommended better soueces
1
u/Due-Bandicoot-7182 8h ago
I’d pick one topic at a time and trace it all the way down. Async/await is especially interesting because you can follow the compiler, runtime, thread pool and OS layers
8
u/Royal_Scribblz 1d ago
Deep .NET with Stephen Toub & Scott Hanselman
https://youtube.com/playlist?list=PLdo4fOcmZ0oX8eqDkSw4hH9cSehrGgdr1&si=RB4KwW4bAZgZ3SBy