Skip to content

Node Worker pthreads pool reuse #9763

Closed
@kripken

Description

@kripken

#9745 supports Node Workers and the pthread pool works properly, but the pool elements are not reused. For example,

https://github.com/emscripten-core/emscripten/blob/incoming/tests/pthread/test_pthread_create.cpp

creates many many threads and destroys them (so at every point in time only a small amount exist). This hangs on node as after exhausting the pool, we have no more workers to use.

I think the issue is that pthread_exit in workers actually exits the entire Worker in node. We call the node process API to do that, as it's better than throwing an exception - which on the Web halts the worker but leaves the application alone, but in Node brings down the whole thing. So I guess we need to find a way to do what we do on the Web, in Node.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions