Enrico Loparco 128c0ea899 Add internal tests for WASI threads (#1963) 2 лет назад
..
wasm-apps 128c0ea899 Add internal tests for WASI threads (#1963) 2 лет назад
CMakeLists.txt 684ae6554d Create a placeholder for WASI threads implementation (#1783) 3 лет назад
README.md 38c67b3f48 thread-mgr: Fix spread "wasi proc exit" exception and atomic.wait issues (#1988) 2 лет назад

README.md

"WASI threads" sample introduction

Currently, since the wasi-sdk does not have thread support in the latest release, make sure to have wasi-libc installed. Build it with threads enabled, e.g.

make \
    AR=/opt/wasi-sdk/bin/llvm-ar \
    NM=/opt/wasi-sdk/bin/llvm-nm \
    CC=/opt/wasi-sdk/bin/clang \
    THREAD_MODEL=posix

Build and run the samples

$ mkdir build
$ cd build
$ cmake -DWASI_SYSROOT=/path/to/wasi-libc/sysroot ..
$ 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