Skip to content
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

Update glow #1195

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update glow #1195

wants to merge 1 commit into from

Conversation

ids1024
Copy link
Member

@ids1024 ids1024 commented Nov 1, 2023

No description provided.

@ids1024
Copy link
Member Author

ids1024 commented Nov 1, 2023

Hm, looking at the clippy error, it seems a change, in particular grovesNL/glow@d62451c7, make glow::Context no longer Send/Sync by adding a raw pointer to it, and not explicitly implementing those traits.

Show glow be implementing those wrappers, or should we wrap it to make it Sync? Assuming we need the renderer to be Send/Sync.

@Drakulix
Copy link
Member

Drakulix commented Nov 1, 2023

Hm, looking at the clippy error, it seems a change, in particular grovesNL/glow@d62451c7, make glow::Context no longer Send/Sync by adding a raw pointer to it, and not explicitly implementing those traits.

Show glow be implementing those wrappers, or should we wrap it to make it Sync? Assuming we need the renderer to be Send/Sync.

It is kinda right for glow to not explicitly implement those, given that this depends on the platform and even on unix this is not clear cut. As long as the context is only made current on one thread at a time, you can move it around, but otherwise stuff breaks.

So I guess it would be more correct for our wrapper to implement Send/Sync and make sure to uphold that invariant.

@ids1024
Copy link
Member Author

ids1024 commented Nov 1, 2023

Yeah, so using it with multiple threads can be unsafe. But glow is all unsafe, and it's up to the caller to know what safety constraints apply to their platform and use of glow.

So I guess it's a matter of taste whether or not such a type should be Send or Sync.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants