线程池是否获得应用程序域之间共享? [英] Does threadpool get shared between application domains?

查看:140
本文介绍了线程池是否获得应用程序域之间共享?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

考虑哪些是创建多个应用程序域的过程。做这些应用程序域共享相同的线程池?如果是的话,它是如何协调多个应用程序域的?

Consider a process which is creating multiple application domains. Do these Application domains share same thread pool? If yes, how is it coordinated between multiple application domains?

推荐答案

线程池是在所有应用程序域共享 - 因为这意味着线程可能最终应用程序域之间的切换也一直围绕这个PERF的工作(可能常常!):

The ThreadPool is shared across all appdomains - since that means threads might end up switching between appdomains (potentially often!) there's been perf work around that:

<一个href="http://blogs.msdn.com/b/ericeil/archive/2009/04/23/clr-4-0-threadpool-improvements-part-1.aspx">http://blogs.msdn.com/b/ericeil/archive/2009/04/23/clr-4-0-threadpool-improvements-part-1.aspx

[...]其实,我们违反本规则   已:因为.NET 3.5中,CLR   线程池一直保持独立   FIFO队列中的每个应用程序域   过程中,和一个附加的独立   FIFO队列为原生的工作项目   如那些由主机排队   (ASP.net是这样做的主要用户   特征)。我们之间的循环   这些工作队列,让每个来   对于前一段时间执行工作   移动到下一个。[...]

[...] In fact, we violate this "rule" already: since .NET 3.5, the CLR thread pool has maintained separate FIFO queues for each AppDomain in the process, and an additional independent FIFO queue for "native" work items such as those queued by a host (ASP.net being the prime user of this feature). We round-robin between these work queues, allowing each to execute work for some time before moving on to the next.[...]

顺便说一下,注意严格地说线程池不跨越整个过程共享了,由于v4的CLR允许装载侧由端与V2和每个将具有其自己的线程池。

BTW, note that strictly speaking the ThreadPool isn't shared across the entire process anymore, since the v4 CLR allows loading side-by-side with V2, and each will have its own threadpool.

这篇关于线程池是否获得应用程序域之间共享?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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