Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET Framework support for multicore hardware

Tags:

.net

multicore

I've been tasked to write a high performance, high availability service that will run on a multicore box.

Do I need to make use of Task Parellel Library to really leverage a multicore server or will the service automagically run faster if I throw more hardware (cores) at it? Does the .NET framework provide the magic for me under the covers?

As a corollary, will there be performance gains by upgrading the server with more cores (keeping the spec of each individual core the same) for .NET applications that do not use TPL?

As per my understanding (perusing Joe Duffy's book and his blogs), you really do need to program for multicore. Is my conclusion accurate?

like image 246
Sprash Avatar asked Jul 02 '09 23:07

Sprash


3 Answers

This is difficult to answer accurately since parallel processing is not a generic problem. You'll need to analyze your project to find places where you can leverage parallel processing.

If your application can be easily broken down into concrete independent tasks, parallel processing will definitely improve. If its primarily serial in nature, multiple cores/threads won't really help at all.

If you've determined that parallel tasks represent the core of your process, a parallel library can help you perform the basic tasks as well as make it easier to get right.

like image 162
Paul Alexander Avatar answered Oct 01 '22 23:10

Paul Alexander


Take a look at PLinq which will be coming in .Net 4.0. It will give you a lot of parallel processing capabilities without needing to manage task/load algorithms.

like image 20
Brian Genisio Avatar answered Oct 02 '22 01:10

Brian Genisio


A program needs to have several paths of execution to leverage anything more than 1 core/processor. Typically this is done by running more than 1 thread, as most OS's only way of providing more than execution path is either by running several processes(executables) or several threads within one process.

There's several high level abstractions built into modern languages to more easily dealing with what is essentially multi-threading, but better learn the basics first; Threads

like image 22
nos Avatar answered Oct 02 '22 00:10

nos