Which existing CLR hosts do not provide a one-to-one mapping between managed and unmanaged threads?

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

The ThreadId operating system does not have a fixed connection with a managed thread, because an unmanaged host can control the relationship between managed and unmanaged threads. In particular, a complex host can use the Fiber API to schedule many managed threads against the same operating system thread or to move a managed thread between different operating system threads.

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

+3
multithreading c # clr winapi
Aug 26 '13 at 4:01
source share
1 answer

One of them could be Microsoft SQL Server (since version 2005). IIRC, that some hosting support was even built into CLR 2.0 upon request (also see this blog post for more information) so they can also support CLR when using fibers (e.g. user mode) instead of threads in SQL Server .

However, this never worked, it seems ( source ):

Executing the Common CLR executable (CLR) is not supported in the lightweight pool. Disable one of two options: "clr enabled" or "easy pool".

I would consider it fairly safe to assume that there are no (ready to release) hosts that do not display CLR streams to host 1: 1 streams.

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

For example,

  • Is Thread a Kernel Object?
  • How to get the CLR to display OS thread switching?
+4
Aug 26 '13 at 4:59 on
source share



All Articles