哪些现有的CLR的主机不提供托管和非托管线程之间的一个一对一的映射? [英] What existing CLR hosts do not provide one-to-one mapping between managed and unmanaged threads?

查看:344
本文介绍了哪些现有的CLR的主机不提供托管和非托管线程之间的一个一对一的映射?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我要的不可以依赖于有托管和非托管线程之间有一个一对一的映射。从 MSDN

I know I should not rely upon that there is one-to-one mapping between managed and unmanaged threads. From MSDN:

的操作系统的ThreadId没有固定的关系提高到一个托管线程,因为非托管主机可以控制托管和非托管线程之间的关系。具体地讲,一个复杂的宿主可以使用光纤的API来调度许多管理的线程针对同一操作系统线程,或者移动至托管线程不同的操作系统线程之间。

在现实生活中虽然做这样的CLR主机是否存在?(如果有的话,它们是什么?)我只是回答了相关的问题,我不知道我的建议是如何切实糟糕的<一个href="http://stackoverflow.com/questions/18427186/wait-for-any-thread-to-finish-not-all/18428310#18428310">that特殊情况下的。

In real life though, do such CLR hosts exist? (and if so, what are they?) I just answered a related question, and I wonder how practically bad my advice was for that particular case.

推荐答案

一会或可能是微软的SQL Server(从2005版)。 IIRC特定主机支持是应其要求,甚至内置在CLR 2.0(另见的这篇博客获得更多的背景),因此使用纤维(又名用户模式调度时,他们也可以支持,而不是在SQL Server线程的CLR)。

One would or could have been Microsoft SQL Server (starting with version 2005). IIRC that particular hosting support was even built into the CLR 2.0 upon their request (also see this blog post for more background), so that they could also support the CLR when using fibers (aka user mode scheduling) instead of threads in SQL Server.

但是,从来没有真正做过的工作,似乎(的来源):

However, that never really did work, it seems (source):

公共语言运行库不支持下(CLR)执行   轻型池。关闭两个选项之一:CLR启用或   轻型池。

Common language runtime (CLR) execution is not supported under lightweight pooling. Disable one of two options: "clr enabled" or "lightweight pooling.

我会考虑它,而安全的假设不存在(生产准备)主机在那里,没有映射CLR线程主机线程1:1。

I would consider it rather safe to assume that there are no (production ready) hosts out there, that don't map CLR threads to host threads 1:1.

有一对夫妇的Q&放大器; A周围,这样似乎表明同一

There are a couple of Q&A around SO that seem to suggest the same.

例如,

  • Is Thread is kernel object ?
  • How do I force the CLR to exhibit OS thread switching?

这篇关于哪些现有的CLR的主机不提供托管和非托管线程之间的一个一对一的映射?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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