HOME JAVA & JEE OPEN SOURCE .NET WEB & RIA CLOUD & GRID ARCHITECTURE & DDD AGILE PM & SCRUM AGILE TESTING & BDD OS, MOBILE & SERVER  
In The Brain of Ben Lamb: Make the Most of Your Cores - Parallel Extensions for .NET
Make the Most of Your Cores - Parallel Extensions for .NET
Looking forward to having an 8 core processor in your desktop box? Maybe your server already does? Unfortunately unless your application is designed to use them 7 of those cores are going to be sitting idle. How do you write multi-threaded programs for .NET without the headaches of race conditions and manually tracking threads?

Parallel Extensions for .NET to the rescue! .NET 4.0 will feature a new library to simplify parallel programming and allow your applications to take advantage of multiple cores. This talk will explain what's on offer.

Review:
Parallel extensions for .NET is all about making the most of your cores. Clockspeeds aren’t predictors of pure speed and with Windows 2008R2 supporting up to 256 cores, developers can move away from using (often painful) threads to obtain a performance advantage. In this talk, Ben Lamb takes us through what we can expect in .NET 4.0 Visual Studio 2010. With a library designed to make parallel programming easier, the debugging support, and concurrency profiler, it is possible to develop applications that are lightweight. Using parallel extensions with this new release will ultimately allow you to develop light resident applications to ultimately make the most of your cores.

In his first demo, Ben demonstrates how to waste half your computer power by using sequential processing, making it multi-threaded with each thread having a copy of the stack and equaling 1mb of memory per thread. This makes your app a "bad citizen."

Thread pools don’t provide much control, Ben goes on to say... In his second demo, he uses fine-grained parallelism using tasks such as Wait, WaitAny, WaitAll, ContinueWith, Cancel showing the differences. The tasks are a unit of work and not a unit of scheduling, so you can create hundreds whist keeping everything lightweight. This method automatically maintains the parent-child relationship, so cancellations are easy and they can be chained together.

Structured Parallelism is very useful for modifying existing code and makes uses of task under the hood. Parallel.For and Parallel.ForEach enables you to parallelise loops and support cancellation. However, you still need to handle locking on shared data structures. Parallel Invoke executes many statements in parallel

Ben’s 4th demo shows how to use parallel states. You might be asking yourself if threads are now dead? Fear not - all existing threads will work as they do today. under .NET 4.0 you will be able to take advantage of the improved debugging support in VS2010 and there will still be occasions when you might prefer using threads.
Review by: Thyran Wright
Download the slides here

ABOUT BEN LAMB
Ben began his coding career in a double garage writing business applications in Visual Basic....
More about Ben Lamb
PODCAST MAKE THE MOST OF YOUR CORES - PARALLEL EXTENSIONS FOR .NET
Digg! StumbleUpon
OPEN SOURCE .NET PODCASTS
Colin Howe:Re-writing Java classes in Scala - and making your code lovely, Re-writing Java classes in Scala - and m
Colin Howe : 8th Feb 2010
View Podcast: Re-writing Java classes in Scala - and making your code lovely,
Emma McGrattan:Waking up to the New Economics of IT, Waking up to the New Economics of IT
Emma McGrattan : 15th Dec 2009
View Podcast: Waking up to the New Economics of IT,
Ian Cooper:A real world guide to architecting MVC Applications, A real world guide to architecting MVC A
Ian Cooper : 14th Dec 2009
View Podcast: A real world guide to architecting MVC Applications,
Sadek Drobi:Computation Abstraction, Computation Abstraction
Sadek Drobi : 7th Dec 2009
View Podcast: Computation Abstraction,
Ganesh Sittampalam:Functional Programming for Quantitative Modelling at Credit Suisse, Functional Programming for Quantita...
Ganesh Sittampalam : 7th Dec 2009
View Podcast: Functional Programming for Quantitative Modelling at Credit Suisse,
Anton Schwaighofer:F# and Units-of-measure for Technical Computing, F# and Units-of-measure for Technical Co
Anton Schwaighofer : 7th Dec 2009
View Podcast: F# and Units-of-measure for Technical Computing,
 :Parkbench Panel Discussion, Parkbench Panel Discussion
: 7th Dec 2009
View Podcast: Parkbench Panel Discussion,
Robert Pickering:Using combinators to tackle the HTML rendering problem, Using combinators to tackle the HTML ren
Robert Pickering : 7th Dec 2009
View Podcast: Using combinators to tackle the HTML rendering problem,
Toby  Henderson:An Introduction to Mono , Mono
Toby Henderson : 3rd Dec 2009
Podcast Coming Soon: An Introduction to Mono ,
Udi Dahan:Command Query Responsibility Segregation, Command Query
Udi Dahan : 16th Nov 2009
Podcast Coming Soon: Command Query Responsibility Segregation,
Dylan Beattie :HTML 5 and ASP.NET, HTML 5 and ASP.NET
Dylan Beattie : 2nd Nov 2009
View Podcast: HTML 5 and ASP.NET,
Mike Hadlow:Enterprise Integration with MassTransit, Enterprise Integration with MassTransit
Mike Hadlow : 1st Oct 2009
View Podcast: Enterprise Integration with MassTransit,
Jan Machacek:Web Applications, Web Applications
Jan Machacek : 21st Sep 2009
View Podcast: Web Applications,
Frank Cohen:Open Source Build & Test Workshop, Open Source Build & Test Workshop
Frank Cohen : 14th Sep 2009
View Podcast: Open Source Build & Test Workshop,
Gojko Adzic:Space Based Programming, Space Based Programming
Gojko Adzic : 2nd Sep 2009
View Podcast: Space Based Programming,
OTHER OPEN SOURCE .NET EVENTS
Udi Dahan:Advanced Distributed Systems Design with SOA,  Adv Distributed Design w SOA
5 DAY COURSE. Featuring Udi Dahan
London, Monday, February 15th
London .NET User Group:Command Query Responsibility Segregation, London .NET User Group
FREE EVENT: Command Query Responsibility S
London, Monday, February 15th
:Progressive .NET Course,  Progressive .NET Course
3 DAY COURSE.
Paris, Wednesday, February 17th
:Agile Web Development with the Castle Framework,  Agile Castle Web Development
2 DAY COURSE.
Paris, Tuesday, February 23rd
Oren Eini aka Ayende Rahien:Core NHibernate: Persistence with NHibernate,  Persistence with NHibernate
3 DAY COURSE. Featuring Oren Eini aka Ayende Rahien
London, Wednesday, February 24th
Oren Eini aka Ayende Rahien Lessons learned from building the NHibernate Profiler,  Lessons learned from building the NHibernate Profiler
FREE EVENT: In The Brain of Oren Eini aka Ayende Rahien
London, Wednesday, February 24th
:Advanced Agile Web Development with Castle Project Framework ,  Advanced Castle Web Development
2 DAY COURSE.
Paris, Thursday, February 25th
:Advanced Distributed Systems Design with SOA,  Adv Distributed Design w SOA
5 DAY COURSE.
Paris, Monday, March 1st
© Copyright 2003-2010, Skills Matter Ltd
  Web development by You In Control
About Us  Jobs  Find Us  Meeting & Training Rooms  Newsletter  Community  Community-FR  Apress  1st Teach  Jobs: Sales Executive  Jobs: Student Podcaster  Jobs: - Facilities Sales  jobs - marketing assistant  Save Bletchley Park  Spring Certification