Taking advantage of SMP

TheWizardofInt

Junior Contributor
Joined
Dec 31, 1969
Messages
333
Location
Orlando, FL
Now that more people are buying dual processor servers, does anyone know of a good resource on how to take advantage of SMP in my programs?

Essentially, I want to engage both processors whenever I can for increased speed and performance - or is this going to be handled by the OS?
 
This will be handled by the OS and server software. Plus, you won't win many supporters for your software if you hog all the system resources on a server.
 
mskeel said:
This will be handled by the OS and server software. Plus, you won't win many supporters for your software if you hog all the system resources on a server.

You know, that is EXACTLY what I was thinking.

Other than writing in a language like Clipper or FoxPro 3.0 or something else that is pre-32 bit, it looks to me like the OS grabs the program and IT decides which resources it deserves.

Other than writing install code that ups all of your process priorities, or getting your end users to do it, I wouldn't know where to begin to tell Windows 'I want a piece of that other processor'
 
TheWizardofInt said:
Other than writing install code that ups all of your process priorities, or getting your end users to do it, I wouldn't know where to begin to tell Windows 'I want a piece of that other processor'
In most cases, if your app asks for a lot of processing power, it's going to get it. Let's face it, for all the computing power we have these days, we rarely use our whole CPU. The only excpetion is when another app is asking for a lot of CPU and then the scheduler will have to get the two applications to share. You should be able to override all that stuff but I'm pretty sure it will involve kernel calls.

I skimmed this a little and it looks like it might be a good start (if nothing maybe it will give you a lead). No matter what, to accomplish overriding the scheduler I'm pretty sure you'll have to get down and dirty and leave the world of .Net for a while. :cool:
 
Any code that uses multiple threads will potentially benefit from multiple cpus / cores.

.Net itself uses multiple threads (main app thread, GC, finalisation) and as such will gain some benefits anyway. Server based apps running under IIS will benefit from multiple cpus as the service itself is already multithreaded.

If you create threads yourself then you may benefit from multiple cpus depending on the operation itself.

Multithreaded code does however need to be designed as such from the ground up and isn't trivial to write / test / debug...
 
PlausiblyDamp said:
Any code that uses multiple threads will potentially benefit from multiple cpus / cores.
You know, I completely spaced out there. For some reason I latched on to wanting to "engage both processors whenever I can for increased speed and performance" and took that to mean trumping the OS scheduler in some way and essentially high jacking the CPU and bending it to your will. Geez! What was I thinking? :o I guess I just had scheduling on the brain or something... :D


PlausiblyDamp said:
If you create threads yourself then you may benefit from multiple cpus depending on the operation itself.
And the CPU loads.


PlausiblyDamp said:
Multithreaded code does however need to be designed as such from the ground up and isn't trivial to write / test / debug...
Amen to that, but don't be discourage becuase it is ussually worth it.
 
Back
Top