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

Use case: Call stack sharing for microfunctions #8

Closed
sffc opened this issue Jan 31, 2020 · 1 comment
Closed

Use case: Call stack sharing for microfunctions #8

sffc opened this issue Jan 31, 2020 · 1 comment

Comments

@sffc
Copy link

sffc commented Jan 31, 2020

We're trying to build an application where WASM is used to run "microfunctions", small stateless functions that can be written once (e.g. in Rust) and then ported via WASM to run in a variety of runtimes. A WASM Memory may be built once and then used again and again for multiple microfunction invocations. The buffers backing the WASM Memories would be owned and destroyed by the host environment.

The multi-memory proposal would be useful for our use case because it would enable a thread to carry around a Memory for its call stack (for Rust objects, not to be confused with WASM's operand stack) and plug it into any module, which has its own Memory for a heap and static variables. When only a single memory is used, it is much harder to reason about the thread safety of call stacks when multiple threads are calling the same module.

In other words, one Memory could be thread-local and mutable, and the other Memory could be cross-thread and read-only.

CC @hagbard @nciric @echeran

Related: rustwasm/wee_alloc#88

@rossberg
Copy link
Member

rossberg commented Feb 3, 2020

Thanks, I added this under the item "Isolation" in the overview.

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