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
Neil Robbins:CQRS Pattern, Event Sourcing and Their Real World Applications, CQRS Pattern, Event Sourcing and Their R
Neil Robbins : 4th Mar 2010
View Podcast: CQRS Pattern, Event Sourcing and Their Real World Applications,
Oren Eini aka Ayende Rahien:Lessons learned from building the NHibernate Profiler, Lessons from building the NHibernate Pro
Oren Eini aka Ayende Rahien : 24th Feb 2010
View Podcast: Lessons learned from building the NHibernate Profiler,
Udi Dahan:Command Query Responsibility Segregation, Command Query Responsibility Segregation
Udi Dahan : 15th Feb 2010
View Podcast: Command Query Responsibility Segregation,
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
View Podcast: An Introduction to Mono ,
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,
OTHER OPEN SOURCE .NET EVENTS
London .NET User Group:Mixing Functional and Object Oriented Approaches to Programming in C# , London .NET User Group
FREE EVENT: Functional and OO Approaches t
London, Wednesday, March 31st
Oren Eini aka Ayende Rahien:Ayende Rahien's Core NHibernate: Persistence with NHibernate,  Persistence with NHibernate
3 DAY COURSE. Featuring Oren Eini aka Ayende Rahien
London, Monday, April 26th
Oren Eini aka Ayende Rahien Introduction into Raven DB,  Introduction into Raven DB
FREE EVENT: In The Brain of Oren Eini aka Ayende Rahien
London, Wednesday, April 28th
Progressive .NET Tutorials, Progressive .NET Tutorials
CONFERENCE (3 DAYS)
London, Wednesday, May 12th BOOK NOW!
Oren Eini aka Ayende Rahien:Ayende Rahien's Core NHibernate: Persistence with NHibernate,  Persistence with NHibernate
3 DAY COURSE. Featuring Oren Eini aka Ayende Rahien
London, Monday, May 17th
:Agile Web Development with the Castle Framework,  Agile Castle Web Development
2 DAY COURSE.
Paris, Tuesday, May 18th
Francis Sanger:Kevlin Henney's Agile Development in C#,  Agile Development in C#
3 DAY COURSE. Featuring Francis Sanger
London, Wednesday, May 19th
:Advanced Agile Web Development with Castle Project Framework ,  Advanced Castle Web Development
2 DAY COURSE.
London, Thursday, May 20th
© 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 - marketing assistant  Spring Certification