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

MediaSource should not require Sync #119

Open
Herschel opened this issue Apr 3, 2022 · 2 comments
Open

MediaSource should not require Sync #119

Herschel opened this issue Apr 3, 2022 · 2 comments
Milestone

Comments

@Herschel
Copy link
Contributor

Herschel commented Apr 3, 2022

#98 added a Sync bound to the MediaSource trait and others, but I'm not sure this is the best idea. This prevents the use of a thread-unsafe MediaSource in a single threaded scenario where it is known there will be no data races.

@pdeljanov
Copy link
Owner

Hi @Herschel,

Sorry for the late response.

Yes, in retrospect I do feel like this was not the best change to make. I think I will probably be reverting this for 0.6.

Do you have a MediaSource that's running into this problem?

@Herschel
Copy link
Contributor Author

Herschel commented May 9, 2022

No worries! Generally it's not a huge issue on the user side, and simply involves adding a Sync trait bound as appropriate. But because Sync is transitive, this can require digging quite deep to ensure the trait is propagated properly. In Ruffle's case, this required us to add some Sync bounds to both our core code and some other decoders (ruffle-rs/ruffle@24f0023). It seems like other users had to do so as well (RustAudio/rodio@21adce6).

So mostly an annoyance in practical cases because most things are Sync anyway, but it could be problematic if someone wanted to use the symphonia types in a non-Sync scenario, such as in a type with non-thread safe interior mutability like RefCell.

@pdeljanov pdeljanov added this to the v0.6.0 milestone Nov 9, 2022
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

No branches or pull requests

2 participants