3 ms·
One thing I wasn't able to ascertain from the link: would this run your Erlang code with the semantics of a single-scheduler BEAM node (i.e. concurrently, but n
by derefr 7y ago
One thing I wasn't able to ascertain from the link: would this run your Erlang code with the semantics of a single-scheduler BEAM node (i.e. concurrently, but not in parallel); or does this use Web Workers to have multiple parallel schedulers?
- lawik 7y agoI think you can get more info from the video linked there. I don't recall the details but if it isn't Web Workers there might be something in Wasm. I'm pretty sure it's intended to be able to run multiple schedulers. But I'm not the one building it so not sure.
- bitwalker 7y agoInitially we’re not planning to support multiple schedulers via WebWorkers, but the runtime has support for multiple schedulers generally speaking. Since the compiler can target other platforms, we didn’t want to artificially limit all targets due to any particular target limitations. As far as Wasm is concerned though, once browser support for SharedArrayBuffer returns, then we’d be looking to take advantage of multiple threads.
- derefr 7y agoThen, could a Lumen user do what pre-SMP Erlang did for parallelism, and 1. run multiple nodes on one machine (i.e. manually create Web Workers each with their own copy of Lumen); and then 2. write an erl_dist alternative-carrier protocol driver that uses worker.postMessage()?
- bitwalker 7y agoSure, I can't imagine any particular reason why that wouldn't work. That said, we don't have distribution implemented yet, since we are focused on a single node in the browser initially; so it depends on which comes first - SharedArrayBuffer being stabilized again in the browsers so we can enable multiple schedulers, or getting distribution implemented thoroughly enough to support the approach you mentioned as a workaround.