Stream: t-lang/wg-unsafe-code-guidelines

Topic: Definition of volatile semantics


RalfJ (Jul 28 2019 at 09:00, on Zulip):

@comex and me are having an interesting discussion at https://www.reddit.com/r/rust/comments/chmnuo/any_unsafe_way_to_get_read_access_to/euyuea4/

RalfJ (Jul 28 2019 at 09:00, on Zulip):

I feel we should put the result of this somewhere into the UCG -- a new issue, at least

RalfJ (Jul 29 2019 at 12:29, on Zulip):

I added a note at https://github.com/rust-lang/unsafe-code-guidelines/issues/33#issuecomment-515969457 because I didn't feel like opening a third issue around volatile would help (we have one for MMIO and one for interaction with concurrency, which I think covers the two things volatile is used for, and they are already mixed up, of course).
The problem is, these threads are both very long, nobody is going to read them entirely. But it's also not like they have reached a firm conclusion or even agreed on a clear core with some open questions. it's just all-around messy and in flux. I am not sure what to do about that.

gnzlbg (Jul 29 2019 at 12:32, on Zulip):

@RalfJ could we use that for black_box ? E.g. saying that black_box is an externally observable event, and then have each backend say what it does in the actual hardware (e.g. nothing)

RalfJ (Jul 29 2019 at 12:39, on Zulip):

@gnzlbg I wondered the same thing, but didn't ponder it yet

gnzlbg (Jul 29 2019 at 12:40, on Zulip):

or maybe worded differently, if we can't say that for black_box, why can we say that for volatile ?

RalfJ (Jul 29 2019 at 13:08, on Zulip):

indeed that would be the question

RalfJ (Jul 29 2019 at 13:09, on Zulip):

I added another post trying to explain what I mean with the first post by means of an example... but this is much harder to explain whan I initially realized^^

RalfJ (Jul 29 2019 at 13:09, on Zulip):

really this is material for several blog posts that I don't have time to write right now, so all I can offer is this braindump

RalfJ (Jul 29 2019 at 13:10, on Zulip):

Now I just have to remember to link to https://github.com/rust-lang/unsafe-code-guidelines/issues/33#issuecomment-515969457 any time volatile comes up, because being burried somewhere in that long thread, nobody is going to be able to find this^^

Jake Goulding (Jul 29 2019 at 13:59, on Zulip):

My opinion, but I think it's fine to edit the initial comment with a table of contents to important comments / other PRs

RalfJ (Jul 29 2019 at 14:06, on Zulip):

yeah I considered that as well. but I am also very biased about what the important comments are. ;)

Last update: Nov 19 2019 at 17:40UTC