O'Reilly logo

C# 5.0 Unleashed by Bart De Smet

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required