News for hackers. Stuff that matters.
Re:Rust at speed – building a fast concurrent database [video] by BagOfPistchios on Sunday January 06, 2019 @01:10AM (#18836865)
Yes you need both compiler barriers for the ordering, as well as memory fences to ensure the global visibility of previous operations in order. It is possible that the mutex implementation he used does no spinning in case of contention and just context switches each time. That could explain the poor performance of mutexes but I don't know the implementation.
Re:Rust at speed – building a fast concurrent database [video] by Jonhoo on Sunday January 06, 2019 @09:11AM (#18838377)
The mutexes were standard Rust Mutex, which I believe just forwards directly to pthread locks. I'm not sure what kind of spinning behavior they have though.
Re:Rust at speed – building a fast concurrent database [video] by the_mitsuhiko on Sunday January 06, 2019 @09:27AM (#18838462)
Rust mutexes are in the process of being redone. The popular parking-lot library js about to replace the platform native ones.
Re:Rust at speed – building a fast concurrent database [video] by kibwen on Sunday January 06, 2019 @09:57AM (#18838601)
Can you link to the discussion this is referencing? I can't imagine parking_lot outright replacing the mutex in std, rather than being added as an optional alternative... what would be the supported way of deliberately using the platform-native mutex?
Re:Rust at speed – building a fast concurrent database [video] by the_mitsuhiko on Sunday January 06, 2019 @11:28AM (#18839053)
The discussion is partially here: https://internals.rust-lang.org/t/standard-library-synchroni...

The PR for std is here: https://github.com/rust-lang/rust/pull/56410

Mostly comes to the platform native APIs habing various soundness issues.

Re:Rust at speed – building a fast concurrent database [video] by Jonhoo on Sunday January 06, 2019 @09:33AM (#18838486)
My hunch would be that the results from the talk wouldn't materially change, except that the Mutex numbers would perhaps be _slightly_ better. The scalability issue would remain though, as it is fundamental to mutexes!
Re:Rust at speed – building a fast concurrent database [video] by gamegoblin on Monday January 07, 2019 @12:20AM (#18842973)
parking-lot mutexes don't support lock poisoning like the standard library mutexes. Wouldn't this be a totally breaking change? Unless poisoning has been added to parking-lot?