Managed and Unmanaged Threading in Microsoft Windows
Note 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 between different operating
system threads
ThreadClass
Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000,
Windows XP Home Edition, Windows XP Professional, Windows .NET Server family
Platform Note: On Microsoft Windows operating systems, a thread represented
by this class corresponds to an operating system thread.
So is the framework sophsticated or not :-) I must admit this is confusing
especially with the results of the test I got . I can't believe that JIT has
anything to do with it - I just confirmed this with ngen . Basically when
creating Threads with the same delegate the Thread class is a lot quicker
than the Threadpool ( except for the first) . So something funny is going
on.
Assumptions / Guesses
The Framework tells the OS to copy the Thread previous thread object.
Lightweight threads are being used on the first thread
Many Managed Threads are being mapped to the same OS thread.
Ben
-----Original Message-----
From: Moderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED]]On Behalf Of Simon E.P. Wilson
Sent: Thursday, 13 June 2002 11:26 PM
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] Threading is blocking itself or ?
Graig Andera wrote:
>> Also, if you're creating threads via new Thread(), then no, the
Framework is not using fibres or anything like that -
>> it should just be creating one OS thread per CLR Thread object.
This may be a bit off topic, but your statement aroused my interest:
Under what circumstances, if any, does the CLR use fibres?
You can read messages from the Advanced DOTNET archive, unsubscribe from
Advanced DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.
You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.