[CentOS] Is parralel processing automatically done on multi-core CPU's?

Sat Mar 6 10:13:41 UTC 2010
MHR <mhullrich at gmail.com>

On Sat, Mar 6, 2010 at 1:51 AM, Rudi Ahlers <rudiahlers at gmail.com> wrote:
> Hi,
>
> I just noticed this article,
> http://www.howtoforge.net/fully-utilizing-your-x-core-cpu which uses
> http://code.google.com/p/ppss/ for parralel processing.
>
> So, can anyone tell me if parralel processing happens automatically on
> CentOS, or would I need to use this script as well? We mainly have Dual Core
> & Dual CPU, Dual Core (i.e. 8 cores) servers and it would be benefitial to
> know whether any applications on the server could automatically use all 8
> cores, or whether I need todo something on the servers to get this working?
>

I haven't read the articles, but in general the answer is yes and no.

Linux is a multiprocessor capable OS that will automatically use as
many processors as are available and needed to run whatever is in the
running process mix.

However, if your application is single-threaded, it can't be
multi-processed because the OS has no way of knowing how that should
be done.

In order to be run in parallel (note spelling, pls), an application
has to be written to run multiple threads of control be they Linux
threads, multiple processes or whatever.  Most modern OSs are
inherently capable of parallel operation because they will use as many
processes and threads as they need to run the hardware and support
system and user processes that are enabled to do the same.

So, if you want an application to run in parallel, it must be written
to be parallel capable - multiple threads that operate at least
partially independently with appropriate controls to synchronize
critical resources without livelocks or deadlocks.  I don't know the
internal structure of apps I haven't written or worked on, but I'm
pretty sure OOO and probably a fair number of the graphical and
multimedia apps are multiprocessor capable.

The big advantage to having multiple CPUs is being able to run
multiple processes simultaneously, whether that's one multithreaded
app or <#-of-CPUs> different apps, multithreaded or not.

There are other performance issues that also need to be taken into
account, but that can get fairly complex and is not necessarily on
point.

Mark Hull-Richter
Expert Software Developer
Registered Linux User #472807
- sign up at http://counter.li.org/