- 
                Notifications
    You must be signed in to change notification settings 
- Fork 728
Open
Description
I want to use c++ std::thread and atomic in wasm file but wasi does not support them yet.
So I want to try emsdk as I see your sample of tensorflow.
But I always get failed when I try my own code.
I used WAMR-12-30-2021 and have enable WAMR_BUILD_LIB_PTHREAD, WAMR_BUILD_LIBC_EMCC and WAMR_BUILD_LIBC_UVWASI when building linux wamr. And I removed open.o, mmap.o and munmap.o in emsdk's libc.a.
When building wasm app, I add -mbulk-memory, -matomics and other params almost like tf_lite.patch.
I got 6 when call pthread_create and got throw_system_error when use std::thread.
I also test EMCC_ONLY_FORCED_STDLIBS=1 and MALLOC="none". But will got "unlinked import function" error.
My code (including linux CMakelist.txt) is attached.
emcc_thread.zip
Metadata
Metadata
Assignees
Labels
No labels