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?
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With