Re:Rust: 128 bit integers preparing to be released
by Senji on Sunday December 04, 2016 @05:21AM
(#13099490)
What stops you from manually entering a critical region yourself before you do the assignment?
[ Parent
| on HN ]
Re:Rust: 128 bit integers preparing to be released
by Manishearth on Sunday December 04, 2016 @10:15AM
(#13100192)
Could you elaborate on what you mean here? The compiler stops you from trying to mutate things when they're not uniquely owned or atomic (or behind a mutex). When you have a non-unique reference you need to use a bunch of unsafe function calls to force mutation on it.
Re:Rust: 128 bit integers preparing to be released
by seeekr on Sunday December 04, 2016 @12:59PM
(#13100903)
Not GP, but iiuc he is just stating: In order to prevent these kinds of race conditions you can just use any regular locking mechanism. (As you could with many other cases where you'd like to introduce atomicity manually.)
Re:Rust: 128 bit integers preparing to be released
by Manishearth on Sunday December 04, 2016 @03:07PM
(#13101529)
Right, and the compiler forces you to do so.