c# - 逻辑线程 vs 物理线程

标签 c# wpf clr

我在这个链接上阅读了有关 System.Threading.DispatcherObject 类型的信息 http://msdn.microsoft.com/en-us/library/ms750441.aspx

文章提到了逻辑线程和物理线程之间的一对一关系。这是文章的片段:

During the design phase of WPF, the goal was to move to a single thread of execution, but a non-thread "affinitized" model. Thread affinity happens when a component uses the identity of the executing thread to store some type of state. The most common form of this is to use the thread local store (TLS) to store state. Thread affinity requires that each logical thread of execution be owned by only one physical thread in the operating system, which can become memory intensive

有人可以吗。解释逻辑线程与物理线程之间的区别是什么?

最佳答案

本地线程是运行时内的线程。该线程比成熟的物理线程更轻量级,适用于更轻量级的进程。物理线程是处理器上下文切换到并处理的线程。随着操作系统跟踪它,它有更多与之关联的元数据。涉及更多细节,但这是一个快速概述。

在这种情况下,物理线程将在内部包含这些逻辑“虚拟线程”。

关于c# - 逻辑线程 vs 物理线程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18857107/

相关文章:

c# - 如何在 WPF 中释放鼠标左键时触发事件?

c# - c#中的扩展方法和静态方法不匹配原型(prototype)匹配

c# - EF CTP 5中没有Key属性

c# - 为什么我不能在 foreach 循环中设置迭代变量的属性?

.net - 在数据模板中查找文本框

c# - WPF 图表控件

c# - 为什么 MigraDoc 在我的 asp.net 应用程序中生成空白 pdf?

c# - .Net CLR 如何在内部实现 "Interface"?

C++/CLR 托管单元测试有链接器错误

c# - clr abi文档中的"this"指针