SetMinThreads Call returns true, but does not change value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am attempting to use the ThreadPool.SetMinThreads method as shown in the MSDN example code:
int minWorker, minIOPort;
int newWorker,newIOPort;

ThreadPool.GetAvailableThreads(out minWorker, out minIOPort);
bool flag = ThreadPool.SetMinThreads(4, minIOPort);
ThreadPool.GetAvailableThreads(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
 
Hi,

ThreadPool.SetMinThreads sets the number of idle threads the ThreadPool
maintains in anticipation of new requests, while
ThreadPool.GetAvailableThreads get the current available threads number
between max threads and current active threads. So SetMinThreads will not
effect the return value of GetAvailableThreads.
SetMinThreads is introduced to increase the performance of your application.
For how to use GetAvailableThreads 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: AcOdkFO7GpwhhUUmRXeHFB4Rpipk8w==
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| From: =?Utf-8?B?VGltIEJlZ2lu?= <[email protected]>
| Subject: SetMinThreads Call returns true, but does not change value
| Date: Tue, 28 Oct 2003 12:16:10 -0800
| Lines: 14
| Message-ID: <[email protected]>
| 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.public.dotnet.languages.csharp
| NNTP-Posting-Host: TK2MSFTCMTY1 10.40.1.180
| Path: cpmsftngxa06.phx.gbl!cpmsftngxa10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:194842
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| I am attempting to use the ThreadPool.SetMinThreads method as shown in
the MSDN example code:
int minWorker, minIOPort;
int newWorker,newIOPort;

ThreadPool.GetAvailableThreads(out minWorker, out minIOPort);
bool flag = ThreadPool.SetMinThreads(4, minIOPort);
ThreadPool.GetAvailableThreads(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

|
 
Back
Top