Skip to content

Single threaded concurrency for emscripten #340

@Umenokin

Description

@Umenokin

From coro's CMakeLists.txt it seems libcoro forcing pthread flags:

if(DEFINED EMSCRIPTEN)
    add_compile_options(-fwasm-exceptions)
    add_compile_options(-pthread)
    add_compile_options(-matomics)

    add_link_options(-fwasm-exceptions)
    add_link_options(-pthread)
    add_link_options(-sPROXY_TO_PTHREAD)
    add_link_options(-sALLOW_MEMORY_GROWTH)
    add_link_options(-sEXIT_RUNTIME)
endif()

But why not supporting single threaded builds? It seems there are certain performance constrains using web workers for threads and many projects still using single threaded builds. I was checking taskflow and libcoro. Generally either would've work for my case but single threaded concurrency felt like strong advantage, especially for wasm builds

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions