05-30-2012 12:56 PM
Hi y'all
I have a big program to say the least and I had read that Async timers are limited to 16 on a windows machine in the help for creating a newAsyncTimer.
Now I have a couple of questions that need answered.
1) Is there a function or command that you can run during a program execution that tells you the number of active Async timers running in the program?
2) What happens if you go over 16 timers? Is it caught by the compiler, do you encounter a runtime error during program execution, does the program just freeze up, what type of indications do you get that you exceeded your limit??
05-30-2012 04:28 PM
While the short answer to Q1 is "no" (you'll have to count the timers in a global variable while creating them) I cannot say anything for sure on Q2. It is possible that you get some run-time error while creating the 17th async timer (possibly error -2: No more IDs are available to assign to a new timer), or it just can remain frozen until some of the existing timers are discarded, don't know.
But I would warn you that having a lot of timers running is not a optimal scenario as they all share the same thread and as you can see in this discussion they may influence one each other. You should consider switching to a true multithreading architecture instead, creating an appropriate number of threads for all the tasks you need.