Groups | Blog | Home
all groups > dotnet performance > november 2003 >

dotnet performance : thread pooling


Lisa Sonneson
11/19/2003 8:34:35 AM
Hi.. I created a .NET windows service that transfers data from and to
different data sources. I would like to use thread pooling to add the
flexibility to run transfers simulteneously but want to be able to control
what transfers go into what threads. Don't know how thread pooling works.
Please if anybody can send me some links or facts that I should be aware of
in using thread pooling, It will be greatly appreciated.
Thanks,
Lisa

Nick Wienholt
11/20/2003 4:02:04 PM
There is plenty of thread pool material on MSDN that talks about the general
concepts. In the case you describe, thread pooling is not appropriate
because it offers no facility to control the thread that a particular
operation occurs on. If this requirement can't be worked around, you'll
need to use threads that you manually create, which has an overhead in terms
of code and (in most cases) performance, but gives you greater flexibility.

Nick Wienholt, MVP
Maximizing .NET Performance
http://www.apress.com/book/bookDisplay.html?bID=217
Sydney Deep .NET User Group www.sdnug.org


[quoted text, click to view]

Paul Glavich
11/23/2003 9:19:30 PM
There is a fully managed thread pool class written by Stephen Toub on
www.gotdotnet.com that might be able to help you. I have used it and it
seems to work quite well but we only used it write a multi-threaded tool to
stress test some components. In your case, you could define multiple methods
that conformed to the required delegate definition and do a bit of logic to
determine which one to add into the thread pool. Again, dont know how its
performance compares to the standard thread pool, but it also gives you the
complete source code so you could tune/alter to your needs.

--
- Paul Glavich


[quoted text, click to view]

AddThis Social Bookmark Button