多核系统和XP 32 / Longhorn - XP x64 [英] Multicore systems and XP 32/Longhorn - XP x64

查看:113
本文介绍了多核系统和XP 32 / Longhorn - XP x64的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于多核处理器即将成为主流,

多线程也将成为主要关注点。


但是我想的可能是小/中型应用程序

多线程优化不应该是一个主要的问题,除了它有意义的

情况(例如下载应用程序

。一个线程执行网络连接并下载并单独的

线程更新数据信息:下载速度,下载了多少
,剩余时间等等。 >

另一方面,Windows会在不同的处理器内核上分配不同的进程

(应用程序),以实现更高的处理器核心利用率。

我的问题是这样的.Windows XP32 / Longhorn - XP x64为多处理器系统中的不同处理器分配不同的
进程(而且我是
假设这也适用于多核C. PU)或不是?

解决方案

" Ioannis Vranos" < iv*@remove.this.grad.com>在留言中写道

新闻:%2 *************** @ TK2MSFTNGP10.phx.gbl ...

我的问题是这个。 Windows XP32 / Longhorn - XP x64是否为多处理器系统中的不同处理器分配了不同的处理(我认为这也适用于多核CPU),或者不是吗?




你可能应该在内核组中再次发帖:


microsoft.public.win32.programmer.kernel


也就是说,调度程序的Win32操作系统工作单元是一个

线程,而不是一个进程。现在每个过程都可以具有其亲和力。对于使用SetProcessorAffinityMask()设置的一组处理器(自然

吸引力)。

线程也可以通过SetThreadAffinityMask()获取处理器

这个制作是拥有过程''面具的一个子集。


据我所知,我可能会弄错,这就是为什么你应该重新发布
$内核组中的b $ b,_default_的进程和线程与系统中的每个处理器都具有亲和力。


问候,
Will


William DePalo [MVP VC ++]写道:

" Ioannis Vranos" < iv*@remove.this.grad.com>在消息中写道
新闻:%2 *************** @ TK2MSFTNGP10.phx.gbl ...

我的问题是这个。 Windows XP32 / Longhorn - XP x64是否为多处理器系统中的不同处理器分配了不同的进程(我认为这也适用于多核CPU),是否?



microsoft.public.win32.programmer.kernel

那就是说,调度程序'' Win32操作系统的工作单元
是一个线程,而不是一个进程。现在,对于使用SetProcessorAffinityMask()设置的一组处理器,每个进程都可以具有亲和力(自然吸引力)。线程也可以通过SetThreadAffinityMask()绘制到
处理器,其中make是拥有进程掩码的子集。
据我所知,我可能会弄错这就是你应该在内核组中再次发帖的原因,_default_
对系统中的每个处理器都有一个亲和力。




是的,他们这样做。每个线程还具有优选处理器。并且如果可能的话,只要它准备好运行,就会在该处理器上安排


首选处理器在创建进程时从0开始,并且每次创建一个线程时以
为增量模数处理器数量。

Win XP及更高版本也知道打开超线程的虚拟

处理器之间的缓存关联,并将使用该信息

尝试将线程保持在单个物理CPU,如果它有选择。


-cd


Carl Daniel [VC ++ MVP]写道:
< blockquote class =post_quotes>是的,他们这样做。每个线程还具有优选处理器。并且如果可能的话,只要它准备好运行,就会安排在该处理器上。
首选处理器在创建进程时从0开始,并且每次创建一个线程时以处理器数量为模递增。
Win XP及更高版本也知道缓存关联在启用了超线程的虚拟处理器之间,并且如果可以选择,将使用该信息来尝试将线程保持在单个物理CPU中。



真好。因此,如果我们在

多处理器/多核系统上运行两个独立的.NET应用程序,我们可以假设如果可用,它们将在不同的处理器/核心上运行



或者是否有可能两者都在一个上运行,而另一个

将闲置?


Since multicore processors are about to become mainstream soon,
multithreading will become a main concern too.

However I am thinking that perhaps for small/medium-sized applications
multithreading optimisation should not be a major concern apart from the
cases where it makes sense (for example a downloading application where
one thread performs the network connection and download and a separate
thread updates the data information: download speed, how much has been
downloaded, remaining time etc.

Windows on the other hand would assign different processes
(applications) on different processor cores by its own for more
efficient processor core utilisation.
My question is this. Do Windows XP32/Longhorn - XP x64 assign different
processes to different processors in multiprocessor systems (and I
assume this applies also to multicore CPUs), or not?

解决方案

"Ioannis Vranos" <iv*@remove.this.grad.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...

My question is this. Do Windows XP32/Longhorn - XP x64 assign different
processes to different processors in multiprocessor systems (and I assume
this applies also to multicore CPUs), or not?



You''d probably be wise to post again in the kernel group:

microsoft.public.win32.programmer.kernel

That said, the scheduler''s unit of work for Win32 operating systems is a
thread, not a process. Now every process can have its "affinity" (natural
attraction) for a set of processors set with SetProcessorAffinityMask().
Threads as well can be drawn to processors with SetThreadAffinityMask()
where this make is a subset of the owning process'' mask.

As far as I know, and I might be mistaken which is why you should post again
in the kernel group, processes and threads by _default_ have an affinity for
each and every processor in the system.

Regards,
Will


William DePalo [MVP VC++] wrote:

"Ioannis Vranos" <iv*@remove.this.grad.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...

My question is this. Do Windows XP32/Longhorn - XP x64 assign
different processes to different processors in multiprocessor
systems (and I assume this applies also to multicore CPUs), or not?



You''d probably be wise to post again in the kernel group:

microsoft.public.win32.programmer.kernel

That said, the scheduler''s unit of work for Win32 operating systems
is a thread, not a process. Now every process can have its "affinity"
(natural attraction) for a set of processors set with
SetProcessorAffinityMask(). Threads as well can be drawn to
processors with SetThreadAffinityMask() where this make is a subset
of the owning process'' mask.
As far as I know, and I might be mistaken which is why you should
post again in the kernel group, processes and threads by _default_
have an affinity for each and every processor in the system.



Yes, they do. Each thread also has a "preferred processor" and will be
scheduled on that processor, if possible, whenever it''s ready to run. The
preferred processor starts out at 0 when the process is created and is
incremented modulo the number of processors every time a thread is created.
Win XP and later is also aware of the cache affinity between virtual
processors with hyperthreading turned on, and will use that information to
try to keep a thread within a single physical CPU if it has a choice.

-cd


Carl Daniel [VC++ MVP] wrote:

Yes, they do. Each thread also has a "preferred processor" and will be
scheduled on that processor, if possible, whenever it''s ready to run. The
preferred processor starts out at 0 when the process is created and is
incremented modulo the number of processors every time a thread is created.
Win XP and later is also aware of the cache affinity between virtual
processors with hyperthreading turned on, and will use that information to
try to keep a thread within a single physical CPU if it has a choice.


That''s nice. So if we have two separate .NET applications running on a
multiprocessor/multicore system, may we assume that they will both run
on different processors/cores if there are available?
Or is there the possibility that both will run on one, and the other one
will be sitting idle?


这篇关于多核系统和XP 32 / Longhorn - XP x64的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆