wasi-threads icon indicating copy to clipboard operation
wasi-threads copied to clipboard

memory import name

Open yamt opened this issue 2 years ago • 1 comments

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?

yamt avatar Feb 15 '23 09:02 yamt

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

sbc100 avatar Feb 15 '23 16:02 sbc100