|
|
Subscribe / Log in / New account

Proper Community Engagement

Proper Community Engagement

Posted Sep 8, 2024 9:22 UTC (Sun) by mb (subscriber, #50428)
In reply to: Proper Community Engagement by Wol
Parent article: Rust-for-Linux developer Wedson Almeida Filho drops out

>Am I right in thinking that would be okay in unsafe code, provided the mutable reference never escaped the unsafe block?

The unsafe block as such doesn't give you rights to violate rules.
It gives you access to deref of raw pointers, but you still have to adhere to the rules.
It does also give you access to some unsafe intrinsics, which might be what you need.
But you can't simply put an unsafe block around your data race and then hope it's fine. It's still a forbidden data race.
So you can for example use an unsafe atomic intrinsic to avoid the data race.


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds