Starting Asynchronous Work Using Tasks

As multi-core processors are quickly becoming ubiquitous, it becomes increasingly important to use parallel and asynchronous programming techniques to create responsive, high-performance applications. The latest .NET releases have responded to this need by introducing the Task Parallel Library (TPL) in .NET 4, and the async/await keywords in C# 5.

We have created a set of fast-paced, code-driven videos on asynchronous programming in C# using TPL and async/await, with a focus on the Task-based Asynchronous Pattern (TAP). If you want a concise introduction to Tasks and async/await, these videos are for you! The videos are under 5 minutes each, and are intended to give a quick overview of each subject. The accompanying blog posts have links for further study.

This first video shows how to start asynchronous work using the Task.Run method, which returns a Task or Task<TResult>. The video also shows how to create tasks that are not run on any thread using TaskCompletionSource<TResult>.

Enjoy!

</param></param></param></param></param></param><embed src="https://wistia.sslcs.cdngc.net/flash/embed_player_v2.0.swf?2013-01-16" allowfullscreen="true" allowscriptaccess="always" bgcolor=#000000 flashvars="customColor=949494&hdUrl%5Bext%5D=flv&hdUrl%5Bheight%5D=720&hdUrl%5Btype%5D=hdflv&hdUrl%5Burl%5D=https%3A%2F%2Fwistia.sslcs.cdngc.net%2Fdeliveries%2F02f6d2c6442d7d9efd5e95fdeaf331742921d203.bin&hdUrl%5Bwidth%5D=1280&mediaDuration=247.0&showVolume=true&stillUrl=https%3A%2F%2Fwistia.sslcs.cdngc.net%2Fdeliveries%2F7ef7af6b4b2ab33e5871ae9826d241083ef4a418.jpg%3Fimage_crop_resized%3D580x326&unbufferedSeek=false&videoUrl=https%3A%2F%2Fwistia.sslcs.cdngc.net%2Fdeliveries%2F9bde9552298ba9d9646be49660cf58a353b6909d.bin" name="wistia_7xs5u7a659_html" style="display:block;height:100%;position:relative;width:100%;" type="application/x-shockwave-flash" wmode="opaque"></embed>

For further reading, see:

Next week’s video: Continuation Tasks.

Posted by Scott Fleischman on May 10, 2013