We have an API that handles event timers. This API says that it uses OS callbacks to handle time events (using select (), apparently).
Api also claims this order of execution: read events, write events, timer events
This works by creating a point for the Timer object, but passing the create function to the callback function:
Something like that:
Timer* theTimer = Timer::Event::create(timeInterval,&Thisclass::FunctionName);
I was wondering how it worked?
The operating system processes the timer itself, and when it sees that it is running, how does it actually call the callback? Is the callback being executed in a separate thread of execution?
When I put the pthread_self () call inside the callback function (Thisclass :: FunctionName), it seems to have the same thread id as the thread in which the creator of Timer itself is! (Very vague about this)
Also: what does this priority list mean? What is a recordable event versus a readable event and a timer event?
Any explanation for using select () in this scenario is also explained.
Thanks!
source
share