-
Notifications
You must be signed in to change notification settings - Fork 927
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support multiple event loop instances on Windows #3141
base: master
Are you sure you want to change the base?
Conversation
I'm not sure this is really a good idea. Mostly because objects created by different loops can't really interact with each other. Maybe that's not true on Windows, but I'm not sure we should allow such a use case... |
Not being able to create multiple windows is a rather major limitation that makes Currently |
You can create as many windows as you want with the one event loop. I don't understand why you need multiple loops |
Libraries based on |
@Zoxc well, good for them. But you can't have multiple event loops on macOS for example, you also can't mix winit objects from multiple event loops, since it'll terminate the other loop if you do that. You need a separate processes for them. What you want can only work on basically |
Well this enables it for Windows only. It also works on X11 / Wayland. |
No, Wayland doesn't work like that, it'll need a special API for multiple event loop on Wayland, since it relies on sub-queues. It doesn't work on X11 as well nice, because error handling is As I said, no-one doing something like that usually, they just give a handle to library to draw into (see egui), none GUI clients want to do stuff like that, it's wrong. We could have an option to create as many loops as you want, but why a portable toolkit could enforce a non-portable design? We have exception on |
I don't think your arguments about X11 / Wayland hold water. They also do not apply to exposing this on Windows. |
I'm saying that multiple event loops need a different API to even try to make it work in a safe, reasonable way. Just slapping API which obviously can't work is not the way forward, not that folks usually do it that way, because libraries system libraries have global shared state, which you should be careful about. I'm still not sure why should we try to continue with such designs, just create processes if you really need multiple event loops, that's how usually it's done by clients demanding such API. Out of all platforms only Wayland with subqueues was designed with the concurrent multi-threaded access to the windows, yet it'll need some sort of |
This allows multiple event loop instances on Windows.
This is blocked on #3061 as currently using event loops of different types can cause unsafety.