logoalt Hacker News

Read_once(), Write_once(), but Not for Rust

54 pointsby todsacerdotitoday at 3:04 PM17 commentsview on HN

Comments

bheadmastertoday at 4:32 PM

    An understanding of READ_ONCE() and WRITE_ONCE() is important for kernel developers who will be dealing with any sort of concurrent access to data. So, naturally, they are almost entirely absent from the kernel's documentation.
Made me chuckle.
show 1 reply
gpderettatoday at 3:52 PM

Very interesting. AFAIK the kernel explicitly gives consume semantics to read_once (and in fact it is not just a compiler barrier on alpha), so technically lowering it to a relaxed operation is wrong.

Does rust have or need the equivalent of std::memory_order_consume? Famously this was deemed unimplementable in C++.

show 2 replies
epolanskitoday at 4:21 PM

What is your take on their names instead of "atomic_read" and "atomic_write"?

show 2 replies
chrismsimpsontoday at 3:54 PM

> The truth of the matter, though, is that the Rust community seems to want to take a different approach to concurrent data access.

Not knowing anything about development of the kernel, does this kind of thing create a two tier Linux development experience?

show 1 reply