Hi,
ThreadPool.SetM inThreads sets the number of idle threads the ThreadPool
maintains in anticipation of new requests, while
ThreadPool.GetA vailableThreads get the current available threads number
between max threads and current active threads. So SetMinThreads will not
effect the return value of GetAvailableThr eads.
SetMinThreads is introduced to increase the performance of your application.
For how to use GetAvailableThr eads sample, please refer to:
http://stronglytyped.com/Articles/ThreadPoolTest.html
Hope this helps,
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
| Thread-Topic: SetMinThreads Call returns true, but does not change value
| thread-index: AcOdkFO7GpwhhUU mRXeHFB4Rpipk8w ==
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
| From: =?Utf-8?B?VGltIEJlZ2l u?= <tp*****@ups-scs.com>
| Subject: SetMinThreads Call returns true, but does not change value
| Date: Tue, 28 Oct 2003 12:16:10 -0800
| Lines: 14
| Message-ID: <1B************ *************** *******@microso ft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| NNTP-Posting-Host: TK2MSFTCMTY1 10.40.1.180
| Path: cpmsftngxa06.ph x.gbl!cpmsftngx a10.phx.gbl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1948 42
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
|
| I am attempting to use the ThreadPool.SetM inThreads method as shown in
the MSDN example code:
int minWorker, minIOPort;
int newWorker,newIO Port;
ThreadPool.GetA vailableThreads (out minWorker, out minIOPort);
bool flag = ThreadPool.SetM inThreads(4, minIOPort);
ThreadPool.GetA vailableThreads (out newWorker, out newIOPort);
After running this flag is true, but the worker value is still set to 25.
I am using .Net 1.1.4322 and this call was suppoesly added to address this
situation.
TIA,
Tim
|