logoalt Hacker News

gmueckl • today at 12:51 PM • 2 replies • view on HN

Algorithms that safely mutate the same data structure on multiple threads and do so safely because of some complex algorithmic properties that guarantee that the changes do not overlap?


Replies

afdbcreid • today at 1:36 PM

Rust can do that just fine. https://doc.rust-lang.org/stable/std/cell/struct.UnsafeCell..... "some complex algorithmic properties that guarantee that the changes do not overlap" are exactly the place to use unsafe and encapsulate it.

If you mean things that formally create a data race, then C++ cannot do that either.

tcfhgj • today at 1:22 PM

Why can Rust not do that?

➕ show 1 reply