WindowsPhoneGeek

WPAppInfo

Login | Join (Why?)

rss rss rss
logo

Async CTP – Task based asynchronous programming for Windows Phone

2/22/2012

source: kevinashley.com

Intro

Asynchronous programming is super-interesting especially today, with responsiveness required by all modern devices. In the context of Windows Phone 7, Async CTP Version 3 was released last year, and it's compatible with SDK 7.1, Silverlight 5 and Roslyn CTP. Our takeaways today is using async in the context of Windows Phone 7, understanding TAP (task based asynchronous programming). I'll show you how deep the rabbit hole goes: we'll go beyond basics to exceptions, cancellations, progress, switching threads, combinators and even re-entrancy.

.The good and the ugly of asynchronous programming

Most of us used asynchronous programming: from creating threads to synchronization, it's not an easy process. Creating one thread may be easy, but once we get to composition, it becomes really ugly. Trying to make one thread execute after another, cancel upon a condition, becomes almost impossible on the large scale. We start creating those horrendous state machines that are very hard to understand and write. Fortunately, it's been proven that the asynchronous code can me transformed into a state machine by means of merely a mechanical transformation.  So, we can keep the clean beautiful code that looks like a natural C# code, while the compiler will translate it into a state machine for us behind the scenes. And that's the promise of Async CTP.

...Read more

You can also follow us on Twitter @winphonegeek

Comments

Add comment to 'Async CTP – Task based asynchronous programming for Windows Phone'

Comment

Our Top Articles & Free books

Our Top Tips & Samples