LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Must CmtReleaseThreadPoolFunctionID() be called from the thread in which CmtScheduleThreadPoolFunction() was called?

(Running on Windows XP) If I call CmtScheduleThreadPoolFunction () to start a secondary thread - say from a menu item in the main program, must I call CmtReleaseThreadPoolFunctionID() for the resulting Thread ID from the main thread also, or can I call it from the secondary thread?

 

Perhaps another question would be: is it better to create secondary threads as needed when the main program starts and suspend them? Or is it better to create them as needed?

0 Kudos
Message 1 of 2
(3,339 Views)

It is recommended that you make sure to always terminate every thread other than the main thread before your program terminates.Take a look at the following:

 

http://zone.ni.com/reference/en-XX/help/370051V-01/cvi/uiref/cvilifetime_of_secondary_threads/

 

http://zone.ni.com/reference/en-XX/help/370051V-01/cvi/programmerref/monitoringsecondarythreads/

National Instruments
Applications Engineer
0 Kudos
Message 2 of 2
(3,320 Views)