LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Threads management

Hello,
I have a doubt about multithreaded applications.
I needed my application call a function in another thread that the main thread. Then, I used the 'CmtScheduleThreadPoolFunction' call, with the first parameter beeing DEFAULT_THREAD_POOL_HANDLE. It worked very well.

Now, I need my application to call two different functions, at different threads. It means, I need the two functions mentioned works separately, in different threads. The reason is that these functions perform critical processes, data acquisition processes.

My doubt is if using de DEFAULT_THREAD_POOL_HANDLE parameter at the two 'CmtScheduleThreadPoolFunction' calls become in two different threads (besides the main thread).

Thanks,
Silmarba.
0 Kudos
Message 1 of 3
(2,850 Views)
Yes, every time you call CmtScheduleThreadPoolFunction is will start a new thread. Thread pools are a grouping of threads that handle managing thread creation. The default thread pool referenced by DEFAULT_THREAD_POOL_HANDLE can hold up to 4 threads. If you need more than 4 threads, then create a new thread pool with CmtNewThreadPool.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 3
(2,850 Views)
Thanks Chris, it was all that I needed to know.
0 Kudos
Message 3 of 3
(2,850 Views)