I know I should not rely upon that there is one-to-one mapping between managed and unmanaged threads. From MSDN:
An operating-system ThreadId has no fixed relationship to a managed thread, because an unmanaged host can control the relationship between managed and unmanaged threads. Specifically, a sophisticated host can use the Fiber API to schedule many managed threads against the same operating system thread, or to move a managed thread among different operating system threads.
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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…