How to implement a timer callback that executes in the same execution context
- by Waldorf
Some programming environments like C++ builder have timer components with a callback function which executes in the same execution contexts as where the timer object is created.
I was wondering how to do something similar in plain c++ with threading.
Or are there any other ways to have a callback which is periodically called to perform some task and runs in the same execution context as the calling thread?