2 ms·
What about data races? (I can't find anything about it in this page) Avoiding UB in single threaded programs is the easy part. It's harder for a low level lan
by nextaccountic 3y ago
What about data races?
(I can't find anything about it in this page)
Avoiding UB in single threaded programs is the easy part. It's harder for a low level language like C, but not too hard.
But avoiding UB in multithreaded programs is very very hard. Many "safe" managed languages have UB when you misuse synchronization mechanisms, like Go.
Some languages Java and OCaml manage to avoid UB when you have data races. They do so by disallowing some compiler optimizations. OCaml is the better one in this regard (see the paper "bounding data races in time and space")
- betz47 3y agoXr0 is currently targeting the c89 spec and working up from there, thread safety is something that we would address in C11 (See a previous discussion here https://news.ycombinator.com/item?id=39858240#39858813 https://news.ycombinator.com/item?id=39858240#39858813).
- nextaccountic 3y agoThat's exciting! Is there any proposal or rough ideas or musings or anything that might suggest how Xr0 could possibly guarantee data race freedom? Would it be something like Rust's Send & Sync traits? Or something else entirely?