Softwarefun
Fun in Softwareland
Sea Wind Nature Wind Night Wind

Theme Option

  • Home Page Home
  • About
Subscibe to RSS Feed

DevDays 2009 day 1 Tasks threading and parallel programming.

Uncategorized Add comments

A small introduction for these posts you can find here. The last session of the day was by  Ingo Rammer about parallel programming in .Net 4.0.

The slides and code of this session will be under conferences on http://www.thinktecture.com/.

Multithreading vs Parallelism. Multithreading is easy, just call Thread.start(). It is primarily used to keep the ui responsive.Parallel programming is used to maximally use the cores that are available.

The ray traces sample comes form the parallel extensions.

Ingo shows a demo walking a large tree structure and visualizing this. The first version uses no threading and takes about 1500 ms to complete. In the second version he tries to make a thread for every node. This version blows up, every thread takes up one mb of memory. The third version uses Threadpool.QueueUeserWorkitem, timing is off now because the threads are fire and forget. The fourth version works with the new tasks from the parallel extensions. This version does the work in about 800ms.

More functionality of the Task is making the creation possible using a factory (shorter, cleaner code). Also the results of a task can be simply used, all synchronization is done for you. In the demo he sums up all values in the tree without having to worry about synchronisation.

After that my netbook just closed down. Basically Ingo covered three ways to do parallel programming in C# 4.0.

  • Fine-Grained Parallelism: Task-API and coordination structures (the foundation of it all)
  • Structured Parallelism: Parallel
  • Declarative Parallelism: PLINQ

Ingo is a great speaker and made this last session while everybody was tired still fun.

  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

May 29th, 2009 |

One Response to “DevDays 2009 day 1 Tasks threading and parallel programming.”

  1. Blog » Blog Archive » DevDays 2009 Introduction
    May 29th, 2009 at 3:08 am

    [...] Tasks threading and parallel programming [...]


Leave a Reply

  • Pages

    • About
  •  

    September 2010
    M T W T F S S
    « Nov    
     12345
    6789101112
    13141516171819
    20212223242526
    27282930  
  • Archives

    • November 2009
    • October 2009
    • May 2009
    • February 2009
    • December 2008
    • November 2008
    • March 2008
  • Tags

    Architecture blogging C# Conference Development Devnology Domain specific languages Express Editions links MVC SharpDevelop Twitter
  • Blogroll

    • Clemens Reijnen
    • CodeBetter
    • InfoQ
    • Medelt Siebenge
    • Open Space Code
    • Sidarok
    • StackOverflow
  • MyBlogLog

  • Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org
Get Adobe Flash playerPlugin by wpburn.com wordpress themes
Copyright © 2010 Softwarefun All Rights Reserved
XHTML CSS Log in
Wp Theme by i Software Reviews
Proudly Powered by Wordpress