Wednesday, May 4, 2011

[Visual C# 5.0] CTP-SP1: Refresh of the new Async features containing optimizations, additions and bugfixes

Microsoft recently released a new version of the async features in a CTP-SP1 version. The goal remains the same: enable developers to write asynchronous code in an easy way, so that they do not need to learn any new skills and writing asynchronous code gets as straightforward as writing synchronous code.

The initial pattern of using Task<T> (class that was introduced in .NET 4 with the parallel features) is still the basis for the new async features. Nothing changed concerning that and allover there are no major changes. There are however multiple optimizations, additions and bugfixes (close to 400 bugs were found in the first CTP).

New features and modifications:

  • Visual Studio 2010 SP1 compatibility (the previous CTP only worked with Visual Studio 2010)
  • Support for Windows Phone 7 development
  • The old pattern of using GetAwaiter | BeginAwait | EndAwait was replaced with the new pattern GetAwaiter | IsCompleted | OnCompleted | GetResult that provides better performance and makes fast path more efficient

Some of the bugfixes concern:

  • Possible race conditions in finally blocks
  • Equality tests with Nullables could sometimes evaluate the operands more than once
  • Wrong behavior when accessing the in an async method
  • Several Visual Basic .NET specific bugs

Start using it in your incubation projects to see how you can integrate it into your developments (especially Phone developments). Try it out !! But mind that this is still a CTP version that might evolve and change until the final version and that there is no support. So using it in any production projects is not advised.

You can find the download of the CTP-SP1 here:


No comments: