LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

When using an asynchronous timer need data protection?

Global variable in asynchronous timer callback function need to protect data?

thank you !

 

 

0 Kudos
Message 1 of 4
(3,199 Views)

Access to global variables in an asynchronous procedure (like a thread or timer)generally requires a synchronization mechanism.

0 Kudos
Message 2 of 4
(3,179 Views)

Asyncronous timers are executed in a separate thread, so they are expected to be running while the user is operating on the user interface and possibly on data collected in timer callback. All this means that you need to protect your data from concurrent access from both the timer thread and the main thread (where the user interface is normally handled) to prevent unexpected  program behaviour.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 3 of 4
(3,162 Views)

Thank you very much !

0 Kudos
Message 4 of 4
(3,135 Views)