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

The Store is not Send nor Sync. #565

Closed
Berrysoft opened this issue Nov 18, 2022 · 4 comments · Fixed by #566
Closed

The Store is not Send nor Sync. #565

Berrysoft opened this issue Nov 18, 2022 · 4 comments · Fixed by #566

Comments

@Berrysoft
Copy link
Contributor

wasmi is a great drop-in replacement for wasmtime in most cases. However, the type Store is not Send nor Sync, which is the biggest difference. Store is used everywhere, and in my use case, Send and Sync are needed. Although I can unsafe impl myself, it would be better to look into the code and find out why they are not implemented.

@Robbepop
Copy link
Member

Thank you for pointing that out! Since we try to mirror the Wasmtime API as good as we can we want our Store to be Send and Sync. We should look into how we can do that most efficiently.

@Robbepop
Copy link
Member

May I ask what you are using wasmi for? :)

@Berrysoft
Copy link
Contributor Author

I'm not currently using wasmi (mainly because of the WASI things). However I'd like to try it, because it is an intepreter instead of JIT, which means it could support more platforms.

I'm using WASM for a plugin system in a framework. There are some async and multithreading affairs. It would be good if wasmi supports multithreading by making the types Send and Sync.

@Robbepop
Copy link
Member

Robbepop commented Nov 18, 2022

I just created a PR that makes Store Send and Sync and also adds a test that asserts that Store remains Send and Sync in the future. :)
Fortunately the fix was simpler than I initially feared.

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 a pull request may close this issue.

2 participants