Re: Using multiple-core processors with C++ apps on Windows XP

"Michael Gogins" <[email protected]> Fri, 25 Aug 2006 07:41:11 -0400
Newsgroups gmane.comp.programming.cppug
Message-ID <001a01c6c83b$5d21a6f0$6401a8c0@Toshiba>
In order to take advantage of multiple CPUs, you have to write a multi-threaded application. This can be done directly using thread creation calls in the operating system, or implicitly using parallel processing constructs (this is more advanced and not usually used except in numerically intensive applications).

Writing multi-threaded code is considerably more difficult than writing single-threaded code, because more than one thread may attempt to read from, or write to, the same data at the same time, causing confusion or corruption. This "contention" must be protected against by using some form of mutual exclusion, based either on mutexes, or on lock-free queues of some sort.

Unless there are important things in your code that can happen at the same time without a lot of contention, you may be better off with a single-threaded application.

Regards,
Mike

  ----- Original Message ----- 
  From: Patrick Ryan 
  To: [email protected] 
  Sent: Tuesday, August 22, 2006 8:23 PM
  Subject: [cppug] Using multiple-core processors with C++ apps on Windows XP


  I'm new to the group and I have a console application written in C++ 
  that I need to run on a system with dual quad Xeon processors. 
  Unfortunately when it runs it uses only one of the eight cores, 
  resulting in performance that is scarcely better than when it runs on 
  a system with a single Pentium 4. The application was compiled with 
  Borland C++ Builder 6.

  Any suggestions about how to get it to use the other seven cores?

  I would greatly appreciate some advice.



   

[Non-text portions of this message have been removed]



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/cppug/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/