emscripten-core/emscripten

Exiting pthreads postMessage to report the exit, which requires the main thread to receive events in order to reuse them

Open

#12 400 ouverte le 1 oct. 2020

Voir sur GitHub
 (33 commentaires) (0 réactions) (0 assignés)C++ (3 519 forks)batch import
help wantedmultithreading

Métriques du dépôt

Stars
 (27 361 stars)
Métriques de merge PR
 (Merge moyen 19j 10h) (147 PRs mergées en 30 j)

Description

Hi there,

I'm totally at a loss on what to expect for pthread behavior with my application. I'm using emscripten to implement a wasm module that acts as a portable SIMD library for performing operations. The library calls from Node.JS are designed to be synchronous and leverage memory passing. Inside the library, I'm spawning threads to expedite the operations (performing prefix sums and converting RGB image pixels to YUV). The threads wouldn't even start at the beginning before PTHREAD_POOL_SIZE. Now that I've added it, it works up until N threads have been consumed. PROXY_TO_PTHREAD doesn't seem to do anything meaningful at least not with respect to my application and Node.JS.

I figure if a pool is needed, why not just treat it like a pool instead of exhausting it? On the other hand, what are my alternatives if this can't get resolved? I need to be able to call rgb2y more than one time.

Guide contributeur