Maximum threads limit per process in windows 10?

0

I have a programs that works with threads. I want to know what is the maximum threads limit per process in windows 10 or what is the maximum threads windows 10 can handle?

Sakith Karunasena

Posted 2019-08-10T18:28:35.980

Reputation: 3

1There isn’t a single processor on the market that exceeds the current limit. Any limit would be with the software itself. Consumer versions of Windows only support up to 2 processors – Ramhound – 2019-08-10T18:30:23.210

Maybe take a look at https://docs.microsoft.com/en-us/sysinternals/downloads/testlimit

– HelpingHand – 2019-08-10T18:30:46.597

Answers

0

You'll hit other problems rather than any explicit cap. As explained by Raymond Chen, every thread requires some memory for bookkeeping, notably its stack (where the thread is in its execution of the program). 32-bit processes can only address 4 GB of memory, which will fit about 2,000 threads with the default 1 MB stack allocation per thread or about 12,000 with the smallest possible allocation of 64 KB per thread. 64-bit processes don't have problems with address space, but rather with the actual allocations. My system runs out of memory a little after testlimit64 -t passes 270,000 threads created.

However, programs should not approach any such limit or need to worry about it. Quoting the previously linked post (with broken links fixed):

The “one thread per client” model is well-known not to scale beyond a dozen clients or so. If you’re going to be handling more than that many clients simultaneously, you should move to a model where instead of dedicating a thread to a client, you instead allocate an object. [...] Windows provides I/O completion ports and a thread pool to help you convert from a thread-based model to a work-item-based model.

Ben N

Posted 2019-08-10T18:28:35.980

Reputation: 32 973