1) Yes, unless Linux user played around with their sources :)
2) No they are all in the same thread and handled linearly (so if the main function takes too long, it might happen that a different hooks event is lined up seveal times in the event queue).
3) Depending on the action the hook shall do, yes
4) Correct. And you never should forget to pass an event back to the queue (return data) if there is a different hook that might need it as well (alternative is in the codearchivs -> master event hook)
5) Yes. But the precision of the timer might come in as a problem there
6) Lock etc is not needed. As all runs in 1 thread, the situation where 2 different hooks / code parts try to access something can't come up. (the GC is not threadsafe, so using modules that add threading is a worse idea as well)
7) No. A hook is a function so its knowledge is restricted to its own variables and globals as with any other function
8) the only thing you can do with hooks is a simpler and especially "background controlled" timed programming like automatic updates of the physic calculates, drawing etc.
But you can't do anything like pause a thread or the like as you can't jump back to a specific position within a function.
So most likely you understood some parts of it, but everything refering to threads is wrong and thus I fear the summary as well ...
The only thing you can do through event hooks is let functions execute on their own without beeing part of a specific place in your mainloop.
But still: if a hook is running, the rest of the app is on halt.
2) No they are all in the same thread and handled linearly (so if the main function takes too long, it might happen that a different hooks event is lined up seveal times in the event queue).
3) Depending on the action the hook shall do, yes
4) Correct. And you never should forget to pass an event back to the queue (return data) if there is a different hook that might need it as well (alternative is in the codearchivs -> master event hook)
5) Yes. But the precision of the timer might come in as a problem there
6) Lock etc is not needed. As all runs in 1 thread, the situation where 2 different hooks / code parts try to access something can't come up. (the GC is not threadsafe, so using modules that add threading is a worse idea as well)
7) No. A hook is a function so its knowledge is restricted to its own variables and globals as with any other function
8) the only thing you can do with hooks is a simpler and especially "background controlled" timed programming like automatic updates of the physic calculates, drawing etc.
But you can't do anything like pause a thread or the like as you can't jump back to a specific position within a function.
So most likely you understood some parts of it, but everything refering to threads is wrong and thus I fear the summary as well ...
The only thing you can do through event hooks is let functions execute on their own without beeing part of a specific place in your mainloop.
But still: if a hook is running, the rest of the app is on halt.