You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to build the example as wasm32-unknown-unknown but it requires the js feature.
There is no browser API or wasm-bindgen in a general purpose WASM module.
It would be nice if this would also be supported, or a mention that it will not be supported and why.
In my case I will probably just use rayon normally for native functions that invoke a WASM function.
So the WASM function just handles one job and returns when done.
The native function is wrapped and threaded by Rayon as usual.
Perhaps that's how it should be done.
For web and native compatibility on the same WASM modules, I would probably have to compile the wasm modules using wasm-bindgen-rayon and not use those exports on a native runtime.
It's difficult to get your head around these things so it would be nice to have this explained or demonstrated for everyone.
Rayon can't fully run in general wasm32-unknown-unknown because there's no threading support. We do at least have a single-threaded fallback, so code written with rayon can still work for the most part, but you don't need to do any special setup for that.
If rayon is running natively, then it's orthogonal that the workload may be a wasm module. Rayon won't know anything about it, but you'll need to load the module to run in whatever wasm runtime you've chosen, just as you would if rayon wasn't involved at all.
I tried to build the example as wasm32-unknown-unknown but it requires the js feature.
There is no browser API or wasm-bindgen in a general purpose WASM module.
It would be nice if this would also be supported, or a mention that it will not be supported and why.
In my case I will probably just use rayon normally for native functions that invoke a WASM function.
So the WASM function just handles one job and returns when done.
The native function is wrapped and threaded by Rayon as usual.
Perhaps that's how it should be done.
For web and native compatibility on the same WASM modules, I would probably have to compile the wasm modules using wasm-bindgen-rayon and not use those exports on a native runtime.
It's difficult to get your head around these things so it would be nice to have this explained or demonstrated for everyone.
This also relates to the issues linked here: #93
The text was updated successfully, but these errors were encountered: