Subject: Re: MP Duh's
To: D. E. Evans <sinuhe@xmission.com>
From: Ricardo Ryoiti S. Junior <suga@netbsd.com.br>
List: port-i386
Date: 02/09/2003 21:58:08
	Ola,

On Sun, 9 Feb 2003, D. E. Evans wrote:

> Am I correct in understanding that all userland software must be
> written to either 1) multi-thread with a second processor or 2)
> run on the second processor directly, to take advantage of the
> MP kernel?

	The kernel will distribute the processes/threads between the two
processors, so it's not necessary. For instance, if you've two programs
running at the same time, they may be using different processors.
	If you run only one software with only one process, then, yes,
your software won't take any advantage (except for the fact that other
processes will not disturb yours).

> If I understand this correctly, what software--outside of seti--
> is written to do this?  Or another way of asking the question:
> is my 440FX dual 266mhz system running the second processor
> idly?  If so, how do I take advantage of the new MP capabilities?

	Probably not. To test, run a time-consuming loop and load any
other program. See with top what's going on :)
	One process will use 100% of CPU time, but your system will still
show only 50% busy. The other process will be caught by another CPU.
	Having a dual 1GHz machine does not mean that programs will run as
if they were on a 2Ghz processor, but you can run two
programs/threads/processes (or n * (number of processors)) as if they had
the CPU at 1ghz only for them (of course, efficiency is not 100%).
	When compiling something with make, use make -j 4 and open
top to see what's happening. Your system will fork 4 compiling tasks,
should be much faster.
	Even if you had only one, using make -j 2 (where 2 or 4 means
(number of cpus * 2), should be a bit faster, as you won't waste any tick
when your compiler is doing disk activity.


	[]s
	Ricardo