Thread: l2c# [dev] team
View Single Post
Old 22.03.2006, 02:05   #3
Sindol
Архивный участник
 
Join Date: Oct 2005
Posts: 21
Default

Quote:
Originally Posted by navy
Of cource ^_^
Think about SonicNet, cause .Net ThreadPool is low level priority threads
Not entirely true now in .Net 2.0, it depends on how you use the .Net thread pool.

Using ThreadPool.QueueUserWorkItem will still cause the ThreadPool to use the old .Net 1.0 and 1.1 lower level priority worker thread, which is fine for everything but mission critical operations that could take a long time.

But using the new ThreadPool.UnsafeQueueNativeOverlapped will now use high performance I/O complete port threads, also all .Net asynchronous methods such as those that start with Begin or End (ie BeginReceive, EndDisconnect) now default to using the higher performance I/O CP threads for their workload.

Furthermore .Net 2.0 introduced the SetMaxThreads and SetMinThreads methods to the ThreadPool which let you set the min or max number of both worker threads and I/O CP threads of the ThreadPool, thus breaking the limit of 25 available threads found in .Net 1.0 and 1.1.

Unless for some reason you're using an insanely large amount of QueueUserWorkItem calls, I'd stick to using the default ThreadPool.
Sindol is offline