Skip to content

Good TPL Learning Resources

October 28, 2012

TPL is the Microsoft Task Parallel Library.  It offers an API that makes doing asynchronous and parallel programming much easier, cleaner, and more manageable than in the past.  Keep in mind that Parallel means code that runs on more than one processor at once, and is aimed at using the latest multicore processors to get significant real speed up in algorithms that can be effectively parallelized.

This link will take you to the Microsoft MSDN documentation for TPL http://msdn.microsoft.com/en-us/library/dd460717.aspx.  This page has key links to other good information about Tasks and Parallel Programming.  But first, be sure to check out the TPL links just below.  They are the most helpful ones I’ve found since I started learning this technology in mid-2012.  (P.S. This list is based solely on my own experience, and I am not receiving any compensation of any kind for mentioning them).

If you had only one place to go find very solid information and examples of TPL and multithreading it would be Joseph Albahari’s website http://www.albahari.com/threading/.  This is a must-visit web site for TPL learners.  It gives good coverage of both the Parallel class and the Task class, plus has excellent information on threading and thread synchronzation.  More in depth coverage can be gained from his book C# 5.0 in a Nutshell:  The Definitive Reference at http://www.albahari.com/nutshell/.  Joseph Albahari is also the author of LINQPad which is available at that site.

If you had only one free tutorial to take to rapidly learn about Tasks, Async, and Await take Joseph Albahari’s “Asynchronous Functions in C#” tutorial.  You have to run the tutorial in LinqPad.  Download LinqPad from www.linqpad.net.  Then run LinqPad and navigate to the Samples tab in the lower left side of the screen.  Click on the “Download/import more samples…” link.  Then on the web page that opens, scroll down to “Asynchrony in C#5 Interactive Tutorial, updated for Framework 4.5 RTM” and download the tutorial to LinqPad and page through its examples with text.  It is very well done.  Spend an hour or two with this and you’ll be able to use Tasks, Async and Await to greatly simplify your async code.

If you had only one place to go to find very in depth information and techniques about Parallel Programming in .NET see Parallel Programming with Microsoft .NET:  Design Patterns for Decomposition and Coordination on Multicore Architectures.  The link for this book is http://msdn.microsoft.com/en-us/library/ff963553.aspx.  Or, for videos and samples see http://parallelpatterns.codeplex.com/.  The pattern based approach allows a developer to more easily pick the proper solution for the problem at hand, being aware of the concurrency strengths and weaknesses associated with each pattern.  This is a must read for serious use of parallelism in .NET.

If you had time to read only one introductory magazine article covering TPL, complete with simple examples, see Miguel Castro’s article in the Nov/Dec issue of CODE Magazine entitled “Tasks and Parallelism:  The New Wave of Multithreading”.  A link for this is http://www.code-magazine.com/Article.aspx?quickid=1211071.

If you want a really, really in depth article on Parallel Programming in .NET please read Steven Toub’s white paper “Patterns of Parallel Programming:  Understanding and Applying Parallel Patterns with the .NET Framework 4 and Visual C#”.  It is quite readable, and goes into deeper detail than the above books.  The link is http://www.microsoft.com/en-us/download/details.aspx?id=19222.

Finally, Troy Magennis has a good section on parallel programming in LINQ with PLINQ in his book LINQ to Objects Using C# 4.0:  Using and Extending LINQ to Objects and Paralled LINQ (PLINQ).  The link for this is http://www.hookedonlinq.com/.

So there you have it, places where you can find all the information you can handle on TPL and how to use it.  Have fun and be creative and productive!

George Stevens

Creative Commons License dotnetsilverlightprism blog by George Stevens is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. Based on a work at dotnetsilverlightprism.wordpress.com.

Advertisements
Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: