Beingessner: Rust's Unsafe Pointer Types Need An Overhaul
Beingessner: Rust's Unsafe Pointer Types Need An Overhaul
Posted Mar 22, 2022 3:34 UTC (Tue) by mrugiero (guest, #153040)In reply to: Beingessner: Rust's Unsafe Pointer Types Need An Overhaul by jlombera
Parent article: Beingessner: Rust's Unsafe Pointer Types Need An Overhaul
You probably still need atomics because "go to memory" in pretty much all non-microcontroller hardware really means "go to cache", and if you're sharing with other threads/processes you really want to synchronize the data, not just makes sure it gets out of the register. Your C program typically doesn't know about nor can control how cache gets flushed and sync'd. You may not notice the problem in x86 because MESI solves it behind the scenes, but that's not universal.
For MMIO it works because the OS can mark a page as cache disabled so it goes straight to "memory" (which really is a mapped device).
For MMIO it works because the OS can mark a page as cache disabled so it goes straight to "memory" (which really is a mapped device).
The LWN site is currently under high scraper load, so comment display has been suppressed for anonymous users. If you are a human, you may read the comments by clicking the button below:
Note: you can avoid this step in the future by logging into your LWN account.
