LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Thread waits for other to finish before starting

I start a group of threads (4) at the same time using CmtScheduleThreadPoolFunction(). Three threads will start and do their thing just fine. The fourth waits for one of the threads to finish before it starts. I have already tried using CmtSetThreadPoolAttribute() to set ATTR_TP_MAX_NUM_THREADS to 15. I check the task manager in win2k and at the time my 4th thread is waiting to start, there are only 9 threads going, so there should be empty handles for this thread to execute.

I also have another thread which I use to monitor the state of all four threads and wait for them all to complete before moving to the next stage of my program, which works just fine. It is scheduled after I have scheduled my first four threads,
BTW.

Thanks for any advise!!
0 Kudos
Message 1 of 2
(2,897 Views)
Well, I was able to fix my own problem... Apparently creating a new thread pool which all these threads live in works just fine.
0 Kudos
Message 2 of 2
(2,897 Views)