News for hackers. Stuff that matters.
Re:Rust solves the problem of incomplete Kernel Linux API docs by aaomidi on Saturday August 31, 2024 @12:40PM (#41410016)
Race conditions within rust are technically impossible :)
Re:Rust solves the problem of incomplete Kernel Linux API docs by jrpelkonen on Saturday August 31, 2024 @12:45PM (#41410059)
Safe Rust prevents data races, but not race conditions in general.
Re:Rust solves the problem of incomplete Kernel Linux API docs by CryZe on Saturday August 31, 2024 @01:39PM (#41410429)
Though arguably, the fact that in order to mutate data from multiple threads, the compiler,forces you to use some synchronization primitive, results in you having to think about how you are going to synchronize access, which should lower the chance of race condition bugs overall.
Re:Rust solves the problem of incomplete Kernel Linux API docs by tialaramex on Saturday August 31, 2024 @01:53PM (#41410526)
The analogy I find helpful for this is, you let the cat out your front door and close it. You walk to the back door and close that too.

A race condition (which safe Rust can have) is a normal phenemenon in our world. If we put the cat out the front door, then walk to the kitchen and close that door by the time we reached the back door maybe the cat had run around the outside of the building and come inside again, closing the doors in the wrong order introduced the opportunity for a race - be very careful.

A data race (which safe Rust does not have) is a weird thing caused by the mismatch between how you think the computer works and how it actually works. What happens if Alice tries the put the cat out the front door at the same time Bob tries to put it out the back door? Well, in the real world that cannot happen, either Alice has the cat or Bob does. But for many languages† this sort of nonsense can happen and when it does that's a disaster

† In safe Rust it can't happen, in Java, OCaml and Go it can happen, but it may not be a disaster (the details are different for each, it is a bug though).

Re:Rust solves the problem of incomplete Kernel Linux API docs by irundebian on Saturday August 31, 2024 @03:10PM (#41411113)
Interesting analogy.
Re:Rust solves the problem of incomplete Kernel Linux API docs by aaomidi on Saturday August 31, 2024 @03:35PM (#41411317)
That’s why I said inside rust. If you bring in external factors then of course it can/will happen.
Re:Rust solves the problem of incomplete Kernel Linux API docs by sixfiveotwo on Saturday August 31, 2024 @01:57PM (#41410560)