Skip to content

Conversation

@casaroli
Copy link
Contributor

@casaroli casaroli commented Dec 11, 2025

Switch to WASI-Threads.

The new way of spinning threads in WASM is through WASI-Threads, not with WAMR libpthread implementation. We switch it here.

The -Wl,--max-memory=1048576 parameter is necessary, because lld will set it as default to 0 and not as unlimited, as stated in its documentation.

We might need to adjust the maximum memory to be higher, but 1MB seems enough for now.

Each thread needs 2 pages of memory (so 2x64KB). With 1MB we can have 8 threads.

Attention: this is a major breaking change. This change require WAMR to be compiled with WAMR_BUILD_LIB_WASI_THREADS, which is not the current default in Ocre.

@casaroli casaroli changed the title Wasi threads WASI-Threads Dec 11, 2025
The new way of spinning threads in wasm is through WASI-Threads,
not with WAMR libpthread implementation. We switch it here.

The -Wl,--max-memory=1048576 parameter is necessary, because lld
will set it as default to 0 and not as unlimited, as stated in its
documentation.

We might need to adjust the maximum memory to be higher, but 1MB
seems enough for now.

Each thread needs 2 pages of memory (so 2x64KB). With 1MB we can
have 8 threads.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
@casaroli
Copy link
Contributor Author

Setting as draft until we officially enable WASI-Threads in Ocre.

@casaroli casaroli marked this pull request as draft December 11, 2025 08:43
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
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

Successfully merging this pull request may close these issues.

2 participants