WebAssembly / wasi-threads

139 stars 8 forks source link

memory import name #33

Open yamt opened 1 year ago

yamt commented 1 year ago

currently it's just said:

When instantiating a module which is expected to run
with `wasi-threads`, the WASI host must first allocate shared memories to
satisfy the module's imports.

so, a typical implementation would automatically create shared memories to satisfy all shared memory imports. eg. https://github.com/yamt/toywasm/blob/c674b4edf25ff6880d41d3bd255ca6e468aec0df/lib/shared_memory.c#L20.

i feel it's neater if we make it a bit more controlled. eg. only create a memory for the shared memory import from a specific module/name, eg. wasi:memory.

how do you think?

sbc100 commented 1 year ago

Seems reasonable yes, this limitation can always be relaxed/widened later if we have things like multi-memory, but we are not there yet.