Maximum number of threads

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

Guest

What is the maximum number of threads Windows supports (for all processes),
and what's the maximum number of threads available per process?
Thanks.
 
AFAIK there is nothing hardcoded, it depends on resources you'll exhaust...
Also I've seen once that this question is considered as pointing to a design
problem as you should create as few threads as possible to get the job
done...
 
Amir Shitrit said:
What is the maximum number of threads Windows supports (for all
processes),
and what's the maximum number of threads available per process?

The short answers is: Lots. Tens of Thousands of threads can be created. If
you have a big enough machine (and today's 64-bit hardware can get very,
very big) you can have lots and lots of threads.

The longer answer is: If you're asking this question, you may want to
rethink your design. Creating more than "a few" threads almost always
indicates a design flaw of some sort. Can you explain the problem you're
trying to solve? I know you're pretty new to writing threaded code, so just
describe the problem you're trying to solve, and see if people here can come
up with a cleaner approach.
 
Actually, I'm very experienced in writing multi-threaded applications and I'm
aware of the things you said.
The reason I'm asking these questions is because I'm preparing a
presentation about the subject, and I thought it would be nice to have these
answers if I'm asked about them.
 
Back
Top