SMPng question

Kevin A. Pieckiel pieckiel at
Wed Nov 5 09:44:47 PST 2003

On Wed, Nov 05, 2003 at 11:59:02AM -0500, Jesse Guardiani wrote:
> 1.) What, exactly, are SMPng's advantages over the current
>     SMP implementation as related to userland apps?
>     In other words, I know that the network stack and devices
>     and such will benefit by being able to make use of
>     multiple CPUs, but will normal non-multi-threaded apps
>     be able to use multiple CPUs? Or will an app still have
>     to be multi-threaded in order to take full advantage
>     of an SMP box?

I'm sure others can comment more thoroughly on this than I can,
but basically non-threaded processes won't concurrently use
multiple CPUs.  Afterall, they aren't threaded.  But multiple
non-threaded processes can run concurrently.  One of the larger
differences in this type of scenario will be when system calls
are made by userland apps.  With Giant, there is more contention
for kernel resources, but with SMPng, this has been greatly
relieved.  This is where you can see some performance gains.

> 2.) And, perhaps as an extension to question #1: Will I
>     be able to make use of multiple CPUs to compile programs?

Yes, but only if you have multiple sources to compile.  You're
Hello World program won't compile any faster, but I'd imagine
anything susceptible to concurrent compiling (using -j with
make, for example) would see a benefit.  However, this scenario
is just a specific example of #1 above--multiple non-threaded
programs (gcc in this case) running concurrently.

>     Could I buy one of those cheap $300 quad Xeon 500mhz
>     compaq boxes on ebay and use it as a 2 Ghz compiler box?

No, not really; you're going to lose some performance in just
keeping up with multiple processors.  In other words, it's not
a linear increase in performance when you add processors.
However, if you have up to four things to actively do at the
same time, then a quad Xeon computer will probably benefit you.
Running a web and/or mail server, for example, where you have
concurrent processes handling concurrent connections, is a
good example.  Running your favorite word processor while
crunching WAV's to MP3's, probably.  You'll notice less of
a response-time lag over a single processor computer at the
very least.  Checking your E-Mail while browsing the Internet,
you'll probably not notice anything different, and a single
processor 2.0 GHz computer will probably be faster.


More information about the freebsd-smp mailing list