Re:Klint: Compile-Time Detection of Atomic Context Violation...
by tialaramex on Sunday March 19, 2023 @08:46AM
(#35218417)
Rust offers at least one way to prevent this which would work today (sleep tokens) in the language, which was rejected by the person doing this work mostly because it seems like they thought it'd be a bother, I'd want to see that much better explored before I'm convinced - but then who am I to insist.
You can't attempt sleep tokens in C or C++ because their type systems have the off-by-one error, they assume the smallest type has at least two values and requires at least one byte of storage, whereas Rust acknowledges that types might have zero or one value, and so either be unrepresentable or require no storage at all. The latter makes a sleep token possible.
You can't attempt sleep tokens in C or C++ because their type systems have the off-by-one error, they assume the smallest type has at least two values and requires at least one byte of storage, whereas Rust acknowledges that types might have zero or one value, and so either be unrepresentable or require no storage at all. The latter makes a sleep token possible.