increasing maximum threads per process
-
I'm writing an application to utilize 30 external processors, and I would like to have 2 threads open for each chip (monitoring and control). The program is an MFC app, and I'm using AfxBeginThread to launch each thread. This works great up to 56 threads, but after that Windows won't create any more (I get NULL returned from AfxBeginThread). Including the 5 other threads in my program, Task Manager correctly reports that 61 threads are in use. I need 65. Can I exceed this number in Windows 2000? Is there actually a limit on 61 threads per process? Thank you srs
-
I'm writing an application to utilize 30 external processors, and I would like to have 2 threads open for each chip (monitoring and control). The program is an MFC app, and I'm using AfxBeginThread to launch each thread. This works great up to 56 threads, but after that Windows won't create any more (I get NULL returned from AfxBeginThread). Including the 5 other threads in my program, Task Manager correctly reports that 61 threads are in use. I need 65. Can I exceed this number in Windows 2000? Is there actually a limit on 61 threads per process? Thank you srs
I don't know with AfxBeginThread(), but I always use _beginthreadex() and have created more than 60 threads per processor... - Anders Money talks, but all mine ever says is "Goodbye!"
-
I'm writing an application to utilize 30 external processors, and I would like to have 2 threads open for each chip (monitoring and control). The program is an MFC app, and I'm using AfxBeginThread to launch each thread. This works great up to 56 threads, but after that Windows won't create any more (I get NULL returned from AfxBeginThread). Including the 5 other threads in my program, Task Manager correctly reports that 61 threads are in use. I need 65. Can I exceed this number in Windows 2000? Is there actually a limit on 61 threads per process? Thank you srs
Something else is going on. The theoretical limit is 2048 using default stack size. I would step into the MFC code and see what the problem is. Tim Smith I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
-
I'm writing an application to utilize 30 external processors, and I would like to have 2 threads open for each chip (monitoring and control). The program is an MFC app, and I'm using AfxBeginThread to launch each thread. This works great up to 56 threads, but after that Windows won't create any more (I get NULL returned from AfxBeginThread). Including the 5 other threads in my program, Task Manager correctly reports that 61 threads are in use. I need 65. Can I exceed this number in Windows 2000? Is there actually a limit on 61 threads per process? Thank you srs
The number of threads is limited by the amount of available virtual memory. By default each thread has one megabyte of stack space. This means that you can create at most 2028 threads. To obtain more threads you need to increase your virtual memory or reduce the stack size for each thread. See the CreateThread documentation for addition information.