The Synchronization Context is an abstraction that lets you run a piece of code asynchronously without thinking about the specifics of the current environment. How does it work, and when is it invoked as part of the async workflow? Let’s explore those topics! …
Blog Posts
I wrote a series of articles describing the async/await State Machine produced by the C# compiler when it encounters an asynchronous method. The discussion starts with a high-level conceptual overview and gradually moves towards the intriguing technical details and performance optimizations. …
Let’s examine the concrete implementation of the async/await State Machine along with all the intriguing optimizations performed by the compiler. …
A conceptual implementation of the async/await State Machine …
The async/await State Machine can be easily understood with a comprehensive workflow diagram that models the program flow and the state transitions. Such a higher-level representation is a mandatory step before diving into the implementation details. Let’s see how that looks! …
The Awaitable Pattern plays a vital role in the whole async/await workflow behind the scenes. The best way to understand how it works is to build your own awaitable type. Let’s see how! …
How are closures implemented in C#? How do they “capture” environment variables from different scopes? The idea is simple, but it can have complex implications. That’s why it’s essential to understand the concept in detail. Let’s get some practical intuition inspecting the IL code as a source of truth. …
The common understanding of Polymorphism takes into account only the runtime type of the “receiving” object. That’s the implementation in most languages. But what if we also consider the method arguments as part of the runtime method resolution logic? That’s the idea behind “Multiple Dispatch.” …
The "Clash of Styles" series compare OOP and FP from a very practical standpoint. Modern general-purpose languages support both of the paradigms. Being conscious of that and choosing the right style for your use case is vital for ending up with an elegant and maintainable system. …
The Visitor Pattern addresses a fundamental limitation of Object-Oriented modeling. In OOP, adding a new “operation” is tricky. You have to modify the existing classes, which is error-prone and violates OCP. Let’s look beyond the standard UML diagram and see how the Visitor solves this problem. …









