Set max number of threads in the default thread pool

rustyx 1 Reputation point
2020-08-07T18:42:31.32+00:00

Is there a way to configure the min and max number of threads for the default thread pool?

SetThreadpoolThreadMaximum seems to work only for a non-default thread pool (a pool created with CreateThreadpool):

SetThreadpoolThreadMaximum(NULL, 4); doesn't work, throws 0xC000000D: An invalid parameter was passed to a service or function.

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,498 questions
{count} votes

1 answer

Sort by: Most helpful
  1. David Lowndes 4,711 Reputation points
    2020-08-07T21:00:32.26+00:00

    It's not something I've ever needed to do, but the documentation of QueueUserWorkItem implies you can set it when calling that function.

    0 comments No comments