[PLUG] Are dual core processors really worth it?

Ed Sawicki ed at alcpress.com
Fri Dec 21 21:17:49 UTC 2007


Rogan Creswick wrote:
> On Dec 21, 2007 12:18 PM, someone <plug_1 at robinson-west.com> wrote:
>> If software has to be written a special way to take advantage of dual core
>> processors, do they offer any real benefit?
> 
> My understanding is that dual cores offer almost all the benefits of
> multiple single-core processors.  (IIRC, running multiple processors
> usually allows for higher memory bandwidth, since each proc has it's
> own pipe & cache, but I'm no expert.)
> 
> Assuming that's the case, then any multitasking environment will
> realize some benefits from dual cores.  One application can be running
> on one core while another app is using the second core.  I've been
> using SMP machines for years, and I've always found that a lower
> clockspeed will result in similar performance when multitasking.
> 
> Typically, desktop applications have been written with one processor
> in mind.  Most of the computation is done in a single thread, with
> possible exceptions for IO-bound operations.  It's generally
> non-trivial to take an existing single-threaded application and make
> it multi-treaded, and allow each thread to run independently.  Issues
> with shared memory and synchronization are very difficult to work out,
> especially when you're trying to deal with an existing design and
> implementation that probably doesn't have accurate documentation.  Add
> to that the fact that it's usually extremely difficult to reproduce
> bugs related to race conditions, and the whole process becomes quite a
> nightmare.  Note that this is *only* of concern within each
> application--as long as the OS and any run-time environments (such as
> virtual machines) are capable of dealing with multiple cores /
> multiple processors, then you will see some benefit to a dual core
> processor.  There are also some algorithms for which there is no known
> parallel approach--as far as we know the *must* be run sequentially.
> 
> --Rogan

Taking advantage of multiple cores without having to deal with the
problems that Rogan describes above is one reason why I've been
refactoring some of my existing applications as numerous processes
running in a pipeline. Linux takes care of running the processes
on available cores/CPUs. I get the benefit without the headaches.

Many of my applications invoke processes like awk, sed, sort,
uniq, and other text processing tools. But just the other day
Alan said:

"If you are using BASH to any great degree, you should learn awk
and sed as well. It means you are probably working with legacy
code and the two seem to go together."

Geez, I don't want to run _legacy_ code, so I guess I should
stop doing this.  :-)

Ed



More information about the PLUG mailing list