GoogleChromeLabs / wasm-bindgen-rayon

An adapter for enabling Rayon-based concurrency on the Web with WebAssembly.
https://github.com/RReverser/wasm-bindgen-rayon
Apache License 2.0
404 stars 35 forks source link

Is it possible to initialize thread pool from rust side? #29

Closed felipellrocha closed 10 months ago

felipellrocha commented 2 years ago

I (believe) one needs to initialize the thread pool on a separate thread itself. Is it possible to initialize the thread pool from the rust side using something like wasm_thread (https://github.com/chemicstry/wasm_thread) to spin up the thread that initializes the pool?

jmadotgg commented 2 years ago

Yeah, that would be great!

jmadotgg commented 2 years ago

Okay, probably a duplicate of https://github.com/GoogleChromeLabs/wasm-bindgen-rayon/issues/12.

RReverser commented 2 years ago

Indeed. If there is enough interest, I suppose we could expose it under a feature flag, but I'm hesitant of making the base crate larger (due to async machinery) for a minor convenience.