At what level does the code in timer callbacks operate? Does it have to be reentrant to avoid race conditions? In other words, if I code a function to change a value and another to return the value, and I specify the change value function in a timer callback, and the value has multiple fields, can you guarantee that the change value function won’t be called by the timer and change part of the value while the return value function is running and result in an inconsistent return value?
Classical problem with concurrency, and usually controlled by semaphores or mutexs.