emscripten-core / emscripten-core/emscripten

Cannot Rendering and calling to Fetch API Sync in the main thread

Open
#16,760 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

For using in EMSCRIPTEN_FETCH_SYNCHRONOUS, we should link with: USE_PTHREADS, PROXY_TO_PTHREAD, ALLOW_MEMORY_GROWTH.
My main thread do the following:
1) GL rendering (that can be run only in the main thread as far as I understand).
2) calling to emscripten_fetch with EMSCRIPTEN_FETCH_SYNCHRONOUS.

**The result:**
emscripten_fetch successed.
Rendering is failed in its initialization.

The reason of failing, I supposed, it because that the rendering is pass to Worker thread due to the above linker flags.
so, what should I do in such case when the main thread do a rendering and others pthread calling

**Version of emscripten/emsdk:**
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.4 (14cd48e6ead13b02a79f47df1a252abc501a3269)
clang version 15.0.0 (https://github.com/llvm/llvm-project ce5588fdf478b6af724977c11a405685cebc3d26)
Target: wasm32-unknown-emscripten
Thread model: posix

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.