Umair Ahmed
Umair Ahmed

Reputation: 11694

Thread behavior on multicore machines

Does the threads of a single process run in parallel on a multi-core machine on windows XP? Is the behavior same on different windows versions (windows server editions)

I have heard that only threads of different processes run in parallel.

Upvotes: 0

Views: 379

Answers (3)

Max Strini
Max Strini

Reputation: 2338

Yes, they may run in parallel. Of course you can't count on any specific behavior wrt processor allocation and/or interleaving, since it depends on the whims of the scheduler and what else is running, etc. ...

Upvotes: 0

Henk Holterman
Henk Holterman

Reputation: 273169

Yes, a single process will (normally) run threads on all cores.

You can easily see that by running something busy on 2 threads and looking at TaskManager.

Upvotes: 1

Jon Skeet
Jon Skeet

Reputation: 1499770

Threads within the same process can still run in parallel on a multi-core machine. This should be the case for all editions of Windows capable of running .NET.

Where did you hear that only threads in different processes can run in parallel? Treat that source of information with a huge amount of salt in future (after checking that that's what they really said, and you didn't misunderstand).

Upvotes: 6

Related Questions