Re: Multiprocessor

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Marin Marinov (mlmarinov_at_askme.ca)
Date: 05/21/04


Date: Fri, 21 May 2004 15:26:42 -0400


<snip>
It will use all of the 4 CPUs eventually but it cannot use more than 2
at a time since you have only 2 threads. Which 2 CPUs exactly - you
can't predict. The next time the OS tries to run the thread on the same
CPU it last ran (the soft affinity I mentioned before) in order to
possibly make use of remained data in L2 cache. But again, this is not
guaranteed. Here are 2 great articles on the internal algorithms. Though
they are for NT 4.0, you'll get a pretty good idea of what goes on
behind the scenes:
"Inside the Scheduler"
http://www.winntmag.com/Articles/Index.cfm?IssueID=22&ArticleID=302
http://www.winntmag.com/Articles/Index.cfm?IssueID=23&ArticleID=303

So initially, yes, the application's threads will be dispatched to
different CPUs, you don't have to explicitly code anything to benefit
from the multiple CPUs except the multiple threads (which you have
already done ;). Also by default, the process's affinity mask is set to
"all processors" so here you don't have an issue either.

As for the OS, I'd go with Windows Server 2003. There have been quite
some kernel improvements and this OS really rocks! Doesn't matter which
"modification" you get (Standard,Enterprise,Datacenter) - they all have
the same kernel. I'd stay away from non-server OSs - I have found them
to be generally "slower", but that's a personal observation though there
are technical explanations also. And if you want to take resource
utilization things further and just to ignite your interest check out
"Windows System Resource Monitor" - one more reason to go Win2K3:
http://www.microsoft.com/windowsserver2003/downloads/wsrm.mspx

HTH

-- 
Cheers,
   Marin Marinov
   MCT, MCSE 2003/2000/NT4.0,
   MCSE:Security 2003/2000, MCP+I
-
This posting is provided "AS IS" with no warranties, and confers no 
rights.


Relevant Pages

  • Re: the Z/10 and timers.
    ... much less exploitation of those multiple CPUs in any ... lineal descendants in today's Unisys ClearPath MCP ... August, 1965, which was the machine available with multiple CPUs. ... IBM Consulting Enterprise Software Architect ...
    (bit.listserv.ibm-main)
  • Re: dual core and c
    ... If I have 8 CPUs, then it will make no difference at all to the zip ... So it lefts the job to paralise code for multiple CPUs ... statements is that they have to be complete done on each sequence ... CPU cores into a single microprocessor. ...
    (comp.lang.c)
  • Re: NIU - Sun Neptune 10g - Transmit timed out reset (2.6.24)
    ... With this card you really need multiple cpus and multiple threads ... Single connections will not fill the pipe. ... generic segmentation offload: off ...
    (Linux-Kernel)
  • Re: dual core and c
    ... If I have 8 CPUs, then it will make no difference at all to the zip ... C, according to the standard, is not a language that is up to the ... task of doing anything about parallel or multithreaded programming. ... So it lefts the job to paralise code for multiple CPUs ...
    (comp.lang.c)
  • Re: FastCode - IntToStr B&V v0.12
    ... > I created the code to test for multiple CPUs (and distinguish between ... > logical CPUs added by hyperthreading and "real" cores). ... I agree with Dennis that benchmarks need to be run at the best possible ... Validations aren't measured, so I'm not ...
    (borland.public.delphi.language.basm)