开发者

Thread behavior on multicore machines

Does the threads of a single process run in parallel on a multi-core machine 开发者_StackOverflowon 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.


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).


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.


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. ...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜