Learn C#/VB Async programming
Written by Lucy Black   
Tuesday, 16 August 2011

Could there be such a thing as a painless introduction to asynchronous programming which has become the default style for most applications? Read on ...

Asynchronous programming is the default style for most applications. Anything that has a GUI is bound to be asynchronous, as is anything that uses event handling. In most cases you can just ignore the fact that you are working asynchronously and write event handlers without worrying about blocking the thread that makes everything work. There comes a time, however, when an operation typically takes so long that blocking the thread isn't an option and so you need to recognize the fact that your code is executing in an asynchronous  environment.

VS

The usual solution is to run the code in a non-blocking mode and use a callback - but this is horribly messy. The new facilities in C# 4.0 for asynchronous programming - the Async CTP - allow you to hide the callbacks in syntactic sugar - and this is really good. It makes your code read more like the order of execution suggests it should and this makes it more meaningful, easier to understand and hence less likely to harbor bugs.

If you would like a painless introduction to the Async CPT then take a look at the videos below produced by the Async team and posted on MSDN. The two sets are identical except one uses C# and the other VB. Each video is around five minutes in length.

If you prefer reading about the Async CTP then see our introductory article: Async, Await and the UI problem.

 

Visual C#

Introduction to the Async CTP



Concurrent Downloading with TaskEx.WhenAll

 

Offloading Work with TaskEx.Run

 

Polling and Cancellation

 

Refactoring Functionality into a Library

 

 

Visual Basic

Introduction to the Async CTP

 

Polling and Cancellation

 

Offloading Work with TaskEx.Run

 

Concurrent Downloading with TaskEx.WhenAll

 

Refactoring Functionality into a Library

More information

Async, Await and the UI problem

The videos on MSDN

The Async forum on MSDN

The Async CTP home page

VS

Banner


Taking The Shake Out Of GoPro
12/08/2014

Microsoft Research has outlined a method for effectively taking the shake out of first person videos and condensing them down so that they are actually interesting.



ScratchJr - Teaching Kids To Code With iPad
04/08/2014

A new version of the Scratch programming language for use on the iPad has been designed to help teach young kids, who may not yet have learned to read, to create programs using a touchscreen interface [ ... ]


More News

Last Updated ( Tuesday, 16 August 2011 )
 
 

   
RSS feed of news items only
I Programmer News
Copyright © 2014 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.