This repository has been archived on 2023-11-05. You can view files and clone it, but cannot push or open issues or pull requests.
wasm-micro-runtime/samples/wasi-threads
Enrico Loparco 83659fa42a
Use wasi-sdk 20 pre-release for tests with threads (#2021)
`wasi-sdk-20` pre-release can be used to avoid building `wasi-libc` to enable threads.
It's not possible to use `wasi-sdk-20` pre-release on Ubuntu 20.04 because of
incompatibility with the glibc version:
```bash
/opt/wasi-sdk/bin/clang: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found
(required by /opt/wasi-sdk/bin/clang)
```
2023-03-17 20:02:03 +08:00
..
wasm-apps Use wasi-sdk 20 pre-release for tests with threads (#2021) 2023-03-17 20:02:03 +08:00
CMakeLists.txt Use wasi-sdk 20 pre-release for tests with threads (#2021) 2023-03-17 20:02:03 +08:00
README.md Use wasi-sdk 20 pre-release for tests with threads (#2021) 2023-03-17 20:02:03 +08:00

"WASI threads" sample introduction

To run the sample, wasi-sdk >= 20 is required.

Build and run the samples

$ mkdir build
$ cd build
$ cmake ..
$ make
...
$ ./iwasm wasm-apps/no_pthread.wasm
...
$ ./iwasm wasm-apps/exception_propagation.wasm

Run samples in AOT mode

$ ../../../wamr-compiler/build/wamrc \
    --enable-multi-thread \
    -o wasm-apps/no_pthread.aot wasm-apps/no_pthread.wasm
$ ./iwasm wasm-apps/no_pthread.aot