Live data from Hacker News

Multithreading Rust and Wasm

rustwasm.github.io

1–10 of 47 posts

Re: Multithreading Rust and Wasm

#2
Nice article. Now I know why the ManualResetEventSlim didn't work in c# Blazor. I wasn't aware that multi-threading in wasm was work in progress.

The demo doesn't work on the standard latest firefox yet unfortunately (ver 63.0). Error: "this browser does not have SharedArrayBuffer support enabled". I guess this is a nightly firefox build thing.

Re: Multithreading Rust and Wasm

#3

Nice article. Now I know why the ManualResetEventSlim didn't work in c# Blazor. I wasn't aware that multi-threading in wasm was work in progress. The demo doesn't work on the standard latest firefox yet unfortunately (ver 63.0). Error: "this browser does not have SharedArrayBuffer support enabled". I guess this is a nightly firefox build thing.

Not experimental, you need to enable SharedArrayBuffer in config because it's unsafe (Meltdown/Spectre) as of now, fixes are being worked on.

Re: Multithreading Rust and Wasm

#4

Nice article. Now I know why the ManualResetEventSlim didn't work in c# Blazor. I wasn't aware that multi-threading in wasm was work in progress. The demo doesn't work on the standard latest firefox yet unfortunately (ver 63.0). Error: "this browser does not have SharedArrayBuffer support enabled". I guess this is a nightly firefox build thing.

> this browser does not have SharedArrayBuffer support enabled

It was disabled for Spectre safety reasons, but it can be re-enabled by navigating to "about:config", searching for "javascript.options.shared_memory" and toggling it to enabled. (But it was obviously disabled for good reason, so might want to enable it temporarily)

Re: Multithreading Rust and Wasm

#5

Nice article. Now I know why the ManualResetEventSlim didn't work in c# Blazor. I wasn't aware that multi-threading in wasm was work in progress. The demo doesn't work on the standard latest firefox yet unfortunately (ver 63.0). Error: "this browser does not have SharedArrayBuffer support enabled". I guess this is a nightly firefox build thing.

How are you finding Blazor in general? Is it worth looking into for smaller web apps or is it still far from production readiness?

Re: Multithreading Rust and Wasm

#6

Nice article. Now I know why the ManualResetEventSlim didn't work in c# Blazor. I wasn't aware that multi-threading in wasm was work in progress. The demo doesn't work on the standard latest firefox yet unfortunately (ver 63.0). Error: "this browser does not have SharedArrayBuffer support enabled". I guess this is a nightly firefox build thing.

> this browser does not have SharedArrayBuffer support enabled It was disabled for Spectre safety reasons, but it can be re-enabled by navigating to "about:config", searching for "javascript.options.shared_memory" and toggling it to enabled. (But it was obviously disabled for good reason, so might want to enable it temporarily)

Thanks! That fixed that problem. Except now I get "this browser does not support passive wasm memory". There aren't any obvious javascript.options.* options for that.

Re: Multithreading Rust and Wasm

#7

Earlier quoted context omitted.

> this browser does not have SharedArrayBuffer support enabled It was disabled for Spectre safety reasons, but it can be re-enabled by navigating to "about:config", searching for "javascript.options.shared_memory" and toggling it to enabled. (But it was obviously disabled for good reason, so might want to enable it temporarily)

Thanks! That fixed that problem. Except now I get "this browser does not support passive wasm memory". There aren't any obvious javascript.options.* options for that.

Oh dear sorry about this, it's a little too non-obvious how to see the demo! I've [pushed a small commit](https://github.com/rustwasm/wasm-bindgen/commit/f016ae5846bf...) to update the demo to include information about browser requirements. Today this demo requires Firefox Nightly (64) and requires the `javascript.options.shared_memory` feature to be enabled. Other browsers will likely soon be able to run the demo as well!

Re: Multithreading Rust and Wasm

#8

Nice article. Now I know why the ManualResetEventSlim didn't work in c# Blazor. I wasn't aware that multi-threading in wasm was work in progress. The demo doesn't work on the standard latest firefox yet unfortunately (ver 63.0). Error: "this browser does not have SharedArrayBuffer support enabled". I guess this is a nightly firefox build thing.

How are you finding Blazor in general? Is it worth looking into for smaller web apps or is it still far from production readiness?

It's definitely worth looking into. Although the authors of the library keep reminding the reader that blazor is not production ready I have found that it does everything I need it to. I found that it either works or doesn't at all if there is an unhandled exception in your code to you try to do something that is not supported. However, I haven't found the behavior to be non-deterministic (by that I mean flaky). I guess they may want to change the API before release. What is amazing is the ability to reference .net standard libraries.

Re: Multithreading Rust and Wasm

#10
post #9

Goddamn, the frequency of Rust-related articles on the front page must be really telling something positive about this language and its community.

> must be really telling something positive about this language and its community.

It's because it's the new shiny thing. This basically used to be a ruby on rails post-it board, then C# for a while, then Java when Java 8 Streams were announced, then Go, etc.

I am not saying it's a bad thing -- in fact I can't wait to go through that "write an OS in Rust" blog that was posted here earlier -- but no I don't think it's telling of anything quite yet.

Post reply on HN