Click to See Complete Forum and Search --> : Multi-threaded in multi-processor


chee0007
August 16th, 2007, 06:53 AM
Hi,
I am new to multi-threading, and with our present technology with dual core processors, what kinds of setup can optimise multi-threading efficently?

Can visual c++ or .NET API programs running on Window XP/2K platform do multi-threading efficently on a multi-processor system(dual core) like what a QNX machine could do?

THanks

googler
August 16th, 2007, 08:30 AM
Yes.

Arjay
August 16th, 2007, 02:04 PM
On Windows NT based machines (NT4, 2000, 2003, XP, Vista, etc.), the thread scheduler handles deciding which processor threads get to run. If the machine is a single-proc/single-core machine, all threads will get executed on the one processor (naturely). On dual core/dual processor machines, the scheduler will decide the best core processor for the particular thread. As a programmer, all you need to be concerned with is making sure you synchronize any data that is shared between threads using a cs, mutex, or some other synch object and let the scheduler take care of the rest. I should mention that you can set up the thread processor affinity, but generally you don't need to do this.

Ejaz
August 17th, 2007, 01:26 AM
Perhaps you find this (http://www.codeguru.com/cpp/w-p/system/threading/article.php/c14005/) interesting ;)

exterminator
August 21st, 2007, 03:59 AM
Wow! What happened? The posts following Ejaz's are gone! Something wierd happening with codeguru forums lately.

Ejaz
August 21st, 2007, 04:06 AM
Oops, my bad :blush: . I split the thread. Its here (http://www.codeguru.com/forum/showthread.php?t=432010).

exterminator
August 21st, 2007, 04:29 AM
No problem. Thanks! I had the feeling that it was split but didn't look into GDT. :)