News for hackers. Stuff that matters.
Re:C and C++ Prioritize Performance over Correctness by kouteiheika on Saturday August 19, 2023 @02:01PM (#37191390)
> Rust probably won’t allow me to implement a couple of lockless parallel algorithms I have implemented in my Ph.D.

Why? Can you be more specific? Rust has built-in support for atomics and essentially the same memory model as C++, e.g.:

https://doc.rust-lang.org/std/sync/atomic/struct.AtomicU32.h...

And you can sidestep essentially any requirements of normal Rust using an `UnsafeCell` (e.g. that's how mutexes are implemented, with an `UnsafeCell` holding the data and an atomic).

I've written my share of lockless algorithms and I haven't really noticed any deficiency compared to C++, but then, I'm not an expert in this area, so if there is a deficiency here I'd love to hear about it.

There are no comments on this comment yet.