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

Make a Module buildable from a AsEngineRef instead of AsStoreRef #3372

Closed
ptitSeb opened this issue Nov 24, 2022 · 1 comment
Closed

Make a Module buildable from a AsEngineRef instead of AsStoreRef #3372

ptitSeb opened this issue Nov 24, 2022 · 1 comment
Assignees
Labels
🎉 enhancement New feature! priority-medium Medium priority issue
Milestone

Comments

@ptitSeb
Copy link
Contributor

ptitSeb commented Nov 24, 2022

Motivation

To allows creating a module for multiple threads, it's dependancy to the AsStoreRef (that will not be shared accross threads) needs to be remove. An Engine should be enough to build a Module.

Proposed solution

Create AsEngineRef for Engine, similar to AsStoreRef for the Store, and make the Module buildable from this instead of AsStoreRef
To avoid API breaking chnage, a Store should also implement AsEngineRef.

Additional context

This should allow better scenario of multi-thread usage, as described there: https://github.com/dsherret/slow-wasm-example/tree/slow_drop

@ptitSeb ptitSeb added the 🎉 enhancement New feature! label Nov 24, 2022
@ptitSeb ptitSeb added this to the v3.1 milestone Nov 24, 2022
@ptitSeb ptitSeb self-assigned this Nov 24, 2022
@Michael-F-Bryan Michael-F-Bryan added the priority-medium Medium priority issue label Nov 29, 2022
bors bot added a commit that referenced this issue Nov 30, 2022
3378: Introduced EngineRef and AsEngineRef trait r=ptitSeb a=ptitSeb

# Description
Introduced `EngineRef` structure that is used to build a Module (instead of `StoreRef`) and the `AsEngineRef` trait.
`Store` implement this trait, so there will be no change in writen code even if it's an API change.

This allow to create a Module independantly of a Store, as it can be usefull for multi-thread scenario.

For #3372 

Co-authored-by: ptitSeb <sebastien.chev@gmail.com>
@ptitSeb
Copy link
Contributor Author

ptitSeb commented Dec 6, 2022

Merged

@ptitSeb ptitSeb closed this as completed Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎉 enhancement New feature! priority-medium Medium priority issue
Projects
None yet
Development

No branches or pull requests

2 participants