Re: dual core and c



On Feb 29, 7:13 am, kerravon <kerra...@xxxxx> wrote:
Assuming I am running a C program that is doing some cpu-intensive
work
such as zip -9, I can understand:

If I have 8 CPUs, then it will make no difference at all to the zip
program,
it will only run on one of the CPUs, although this does allow me to
run 8
separate zips simultaneously, which would be cool on a large site.

But what I don't understand is the concept of a "core", as in "dual
core".
What implications does that have for a C program like zip?  

In order for a C program to take advantage of multiple threads of
execution, it will require a non-portable call to create threads or
processes or to use an interface like MPI.
See, for instance:
http://www.cs.cf.ac.uk/Dave/C/node29.html
http://www.mhpcc.edu/training/workshop/mpi/MAIN.html

Does it
have the ability to look at the instructions ahead of time and
pipeline
them or something?  

Usually, the programmer has to take some kind of action, but some
compilers can spit out parallel tasks to some degree.

Pipelining is something that has been around for
a long time.  Did someone just get the bright idea to call it dual
core
instead or what?

Pipelining does not rely upon more than one CPU core. You can have
multiple pipes executing simultaneously on a machine with a single CPU
with only one processor on the CPU.

Assume the zip in question is written in C89, no fancy parallelism -
at
least not inherent in the language itself.

Yes. The Cilk langugage is a modification of C that tries to make
threading more transparent:
http://supertech.csail.mit.edu/cilk/

If you want to actually implement something that works in parallel,
probably pthreads is the closest thing to a ubiquitous interface in
C. It works on Windows and many Unix variants.
http://en.wikipedia.org/wiki/POSIX_Threads

If you are programming in a Unix or POSIX environment, you might try
news:comp.programming.threads:
http://groups.google.com/group/comp.programming.threads/topics?lnk=sg
.



Relevant Pages

  • Re: Advice please to choose cpu & chipset
    ... acceleration which offloads some of the work from the CPU. ... they are reasonably power efficient compared to ... with an OEM system swapping to a lower RPM fan for noise ... run, a dual core system is highly preferred, quad core more ...
    (alt.comp.hardware.pc-homebuilt)
  • Re: what are the most popular building and packaging tools for python ??
    ... I don't think it's a stretch to imagine a CPU core with a "secure kitchen" ... Using this kind of system, a customer would give you his CPU's public key and serial number, ... >net is available and must still offer full functionality no matter what. ...
    (comp.lang.python)
  • Re: [ltt-dev] [RFC git tree] Userspace RCU (urcu) for Linux (repost)
    ... core to another. ... Now, the kernel can't really do that reasonably, but user space possibly could. ... threads on one CPU. ... sleep over the lack of parallelism in the case where the SMP support is ...
    (Linux-Kernel)
  • Re: Perl is too slow - A statement
    ... Why hire a support staff to tell you to update your hardware as a bug fix? ... I assume you mean adding another cpu core as in 'dual-core cpu', ... some apps may benefit and some won't as app benchmarks tell us. ...
    (comp.lang.perl.misc)
  • Re: new computer
    ... Core Duo. ... I also agree that Dell is the best "factory made". ... currently plan to use Vista). ... Is Dual CPU 1.6 Faster than Single CPU 3.4? ...
    (alt.sys.pc-clone.dell)