Closed XU-YaoKun closed 3 years ago
pthreadpool supports EMSCRIPTEN threads and even has optimizations for it, but only in Bazel build. CMake build always use single-thread fallback, mostly because Emscripten CMake toolchain doesn't define any variable to distinguish builds with threading enabled/disabled. If you're looking to enable multithreading in pthreadpool, I suggest to start with the Emscripten CMake toolchain.
when compiling in EMSCRIPTEN environment, there is only
shim.c
got compiled.This is the concerning CMakeLists.txt part,
And after checking the implementation in that file, I found that all tasks are handled serially.
Here is a code snippet from
shim.c
,As all tasks run in main thread, can I say that this thread pool does not support EMSCRIPTEN?