Live data from Hacker News

Fearless Concurrency in Firefox Quantum

blog.rust-lang.org

1–10 of 177 posts

Re: Fearless Concurrency in Firefox Quantum

#3
post #2

Fearless, indeed: https://github.com/servo/servo/issues?page=1&q=thread+race

Rust only saves you from simple races, not more complex ones. That's quite a lot already.

Most importantly, though, it preserves _memory safety_ in concurrent situations, so your stuff won't randomly crash, but properly panic.

It's no silver bullet, but it _is_ the "magic sauce" behind Stylo.

Re: Fearless Concurrency in Firefox Quantum

#4
post #3
post #2

Fearless, indeed: https://github.com/servo/servo/issues?page=1&q=thread+race

Rust only saves you from simple races, not more complex ones. That's quite a lot already. Most importantly, though, it preserves _memory safety_ in concurrent situations, so your stuff won't randomly crash, but properly panic. It's no silver bullet, but it _is_ the "magic sauce" behind Stylo.

More precisely, Rust saves you from data races but not race conditions.

https://blog.regehr.org/archives/490

Re: Fearless Concurrency in Firefox Quantum

#5
post #3
post #2

Fearless, indeed: https://github.com/servo/servo/issues?page=1&q=thread+race

Rust only saves you from simple races, not more complex ones. That's quite a lot already. Most importantly, though, it preserves _memory safety_ in concurrent situations, so your stuff won't randomly crash, but properly panic. It's no silver bullet, but it _is_ the "magic sauce" behind Stylo.

I’m pretty sure Rust saves you from ALL data races so long as you stay within the boundaries of safe code. Do you have anything at all to reference otherwise that says only certain data races are detected while others are not?

To my knowledge you can defeat the compile-time data race detection if you are either doing unsafe or certain scenarios with Cell/RefCell but even in that case you are guaranteed runtime detection rather than compile time detection.

These feature alone is worth its weight in gold.

Re: Fearless Concurrency in Firefox Quantum

#6
post #2

Fearless, indeed: https://github.com/servo/servo/issues?page=1&q=thread+race

I clicked a few of those links and they were mostly instances of the word "race" appearing as part of, for example, "Traceable".

Somewhere on the second page I found a brief mention of a data race in rustc itself (that was fixed).

Looks pretty fearless to me!

Re: Fearless Concurrency in Firefox Quantum

#7
> It replaces approximately 160,000 lines of C++ with 85,000 lines of Rust

Wow! This is great, especially considering how bad and complex (in the bad sense) C++ is. Maybe Rust and Go will finally make the Frankenstein go to sleep

Re: Fearless Concurrency in Firefox Quantum

#8
I like this explanatory comment by Manishearth, a Servo dev, in the thread over on /r/rust:

"This blog post brought to you by the 'how many times can you say 'fearless concurrency' and keep a straight face' cabal.

"Seriously though, I now appreciate that term a lot more. One thing that cropped up in the review of this post was that I didn't have examples of bugs Rust prevented. Because I couldn't think of any concrete ones. Because Rust's safety doesn't work that way, it prevents your concurrency bugs before you realize you had them, by making sure you don't paint yourself into a corner. 'Fearless concurrency' really is the best way of putting this; the benefit was not that it prevented concrete bugs, but that it let us fearlessly and aggressively write code knowing that it would be concurrency bug free."

https://www.reddit.com/r/rust/comments/7cwpbq/fearless_concu...

Re: Fearless Concurrency in Firefox Quantum

#9
Rayon is pretty cool. It's about as powerful as OpenMP, and a bit easier to use.

The fearless concurrency really is ass-saving. For example, my most recent non-bug: I launched two parallel tasks where one would free a shared resource when done. In C that would be intermittent use-after-free. In Rust it was a compile-time error.

Re: Fearless Concurrency in Firefox Quantum

#10
post #8

I like this explanatory comment by Manishearth, a Servo dev, in the thread over on /r/rust: "This blog post brought to you by the 'how many times can you say 'fearless concurrency' and keep a straight face' cabal. "Seriously though, I now appreciate that term a lot more. One thing that cropped up in the review of this post was that I didn't have examples of bugs Rust prevented. Because I couldn't think of any concret…

I've built now several concurrent services with Rust. The language definitely gives confidence to try several things with different approaches to concurrency. None of my services crash (except once per 3-4 months when I deployed something "that will never crash" using `.unwrap()`). The crashes are always my own laziness, but if I follow the pattern of checking return values and unwraping only when the input is static and visible a few lines before, the resulting programs are fast, have a small footprint and basically never crash.

Oh and the tooling! I hope other projects take a serious example how cargo works. It's very hard to use any other build system.

Post reply on HN