12-24-2010 10:28 AM
Global variable in asynchronous timer callback function need to protect data?
thank you !
12-25-2010 12:14 PM
Access to global variables in an asynchronous procedure (like a thread or timer)generally requires a synchronization mechanism.
12-26-2010 01:43 PM
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.
12-28-2010 05:08 AM
Thank you very much !