Streams in a stream

I read about stream pools. A number of sites say that the default maximum threads in a stream pool are 25 (per processor). however, I did not change the maximum threads and when I do:

Threadpool.GetAvailableThreads (from WorkThreads, out compPortThreads);

I get 500 thousand. I am launching a dual core processor, so I would not expect more than 50.

Do I really have 500, 1000 in my pool?

Thanks, John

+3
source share
3 answers

This has changed between versions:

From the documentation for the ThreadPool class in Visual Studio 2005 :

There is one thread pool for each process. The thread pool has a default size of 25 threads per available processor.

ThreadPool Visual Studio 2010:

. 250 1000 -.

: Visual Studio 2008 promises 250 , 25. , ...

+7

.

, .

:

. 250 1000 / .

+7

This method returns the number of threads that can be started, and not what is currently running. The information you read about 25 is maximum, out of date. I'm not sure which version, but the restrictions on threadpool have been greatly strengthened to avoid blocking problems, mainly due to the fact that the developers did not know what they were doing, IMHO.

+2
source

Source: https://habr.com/ru/post/1759904/


All Articles