Skip to content

Support creating multiple instances in a single native program #26

@calvin2021y

Description

@calvin2021y

Feature

It would be very helpful if wasm2native could support:

Creating multiple independent instances of the same compiled Wasm module.

Is the non-sandbox mode can support this?

Benefit

With multiple instance, we can run multi actor in single process with async support.

If non-sandbox with multiple instance is possible, the actor can be fast and easy to scale. At the same time, it can efficiently scan the disk cache without memory copying. or a no-copy network io mode by host function.

Implementation

for a start, the native API need change to something look like this:

int foo_native(w2n_exec_env_t exec_env , int a, int b)
{
    return a+b;
}

void foo2(w2n_exec_env_t exec_env, char * msg, uint8 * buffer, int buf_len)
{
    strncpy(buffer, msg, buf_len);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions