Event callback reentrancy

Hi all!

After registering an event handler with glfwSet*Callback(), is it possible for the callback (or different callbacks for different event types) to be called multiple times in parallel? I looked at the Win32 backend and seems like this won’t happen for that, but is this actually guaranteed for other platforms and any future ones?


Hi @poconn welcome to the GLFW forum,

See the documentation on thread safety:

Because event processing must be performed on the main thread, all callbacks except for the error callback will only be called on that thread. The error callback may be called on any thread, as any GLFW function may generate errors.

Note that you will only get the error callback called on another thread if you call glfw functions from that thread.

Hopefully this answers your question.




Yep, sorry I missed that, I was looking at the “input guide” page but should have checked the intro. Thanks a lot!

1 Like