Hi there,
Lately I've been taking a stab at writing a wrapper library for GLFW, where some of the library functions can ONLY be run from the original thread that spawned the GL window context. This works fine if I spawn the window and redraw the screen from within a blocking while loop within my main function, but what I'm looking to do is asynchronously redraw the window with a timer.
The callback function of a timer does not appear to be executed in the same thread that spawned it. My demo program has all the window initialization in my main function, and then creates a timer with a closure passed as an argument to handle all the window drawing. Once the main function finishes executing, I'm not sure what happens to that thread.
Am I missing something fundamental here, or is this 'working as intended' under the covers with how the Dart event loop is constructed?
Another example of an event loop structure I'm familar with is libuv, where all asynchronous operations eventually return to the main application thread (
https://github.com/joyent/libuv)
Thanks.