Skip to content

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

@aharondavid

Description

@aharondavid

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 (14cd48e)
clang version 15.0.0 (https://github.com/llvm/llvm-project ce5588fdf478b6af724977c11a405685cebc3d26)
Target: wasm32-unknown-emscripten
Thread model: posix

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions