About This eBook by Bart De Smet

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

Building Awaitable Types

Starting from C# 3.0, new language features have not required any change to the underlying CLR infrastructure. This is no different for the asynchronous programming features introduced in C# 5.0. As discussed in depth in the previous section, asynchronous methods use a crafty compile-time rewrite technique to produce a regular method from the runtime’s point of view. Control flow constructs are rewritten in terms of interactions with a method builder object provided in the BCL for .NET Framework 4.5.

Although you could totally imagine a runtime extension to make methods pausable—effectively hoisting the stack frame onto the heap, or using a different technique altogether—there’s no need to make such big changes to the ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required