-
Notifications
You must be signed in to change notification settings - Fork 43
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
Implement Send and Sync for softbuffer types #217
base: master
Are you sure you want to change the base?
Conversation
Previously, types in softbuffer were !Send and !Sync. However it would be nice if types could be shared across threads. Therefore I've made the following changes: - Context<D> is Send+Sync iff D is Send+Sync - Surface<D, W> is Send iff D is Send+Sync and W is Send - Buffer<'x, D, W> is Send iff D if Send+Sync and W is Send Materially, I've made the following changes across the backends: - X11, Wayland and KMS use Arc for their displays instead of Rc. - MacOS uses MainThreadBound to secure windowing resources. This restriction was already implicitly enforced anyhow. - Windows uses a subclassing strategy to manage creating and destroying resources. This subclass is applied to windows that are registered into softbuffer, and is then used to manage resources. Closes #205 Signed-off-by: John Nunley <dev@notgull.net>
Signed-off-by: John Nunley <dev@notgull.net>
@jackpot51 Please advise on Redox failures. I'm not familiar enough with Orbital's internals to know if it is thread safe or not. |
@jackpot51 Friendly reminder. I'm not familiar enough with Orbital to know how to proceed here. |
@jackpot51 confirmed in chat that Orbital's types should be thread-safe. Signed-off-by: John Nunley <dev@notgull.net>
Signed-off-by: John Nunley <dev@notgull.net>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CG impl approved with suggestion applied
Co-authored-by: Mads Marquart <mads@marquart.dk>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Orbital change looks fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirming that Wasm can't be Send
or Sync
.
Signed-off-by: John Nunley <dev@notgull.net>
Signed-off-by: John Nunley <dev@notgull.net>
It seems that there are still bugs in the Windows backend. Sometimes sending a message to a window on another thread doesn't work. Standby while I investigate. |
Previously, types in softbuffer were !Send and !Sync. However it would
be nice if types could be shared across threads. Therefore I've made the
following changes:
Materially, I've made the following changes across the backends:
restriction was already implicitly enforced anyhow.
resources. This subclass is applied to windows that are registered
into softbuffer, and is then used to manage resources.
Send
.Closes #205, still WIP