I ran it a few times to handle the JIT but the Thread behaviour occurs in a
loop. I suspect that the Framework is doing something funnyy eg not mapping
1 Thread to 1 OS thread  , using lightweight objects or intializing the OS
thread by copying an existing Thread. < 5ms for a new Thread ( after the
first) seems to quick for my liking especially compared to a ThreadPool.

Ben

-----Original Message-----
From: Moderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED]]On Behalf Of Craig Andera
Sent: Wednesday, 12 June 2002 11:40 PM
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] Threading is blocking itself or ?


>         Just for information here are the times for a little prog I
wrote
> it is
> interesting that there is an optomisation in Thread.Start() when
starting
> mutliple threads to the same delgate. The first one takes 40 ms and
later
> ones are very quick  (occasionaly the second one takes 10ms) .
> ThreadPools
> are quicker when doing different types of work but you dont seem to
get
> this
> optomisation.
>
> Anyone knows why this occurs is my code wrong ?
>

Don't forget that any code you hit for the first time has to be JITted.

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.

Reply via email to