Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Memory model goals #119

Closed
littledan opened this issue Jul 12, 2016 · 6 comments
Closed

Memory model goals #119

littledan opened this issue Jul 12, 2016 · 6 comments

Comments

@littledan
Copy link
Member

The memory model in https://tc39.github.io/ecmascript_sharedmem/shmem.html#AtomicsObject.MemoryModel describes some of the challenges that the memory model faces. I think it would be good to write down somewhere (either in the spec or in an explainer somewhere) what goals the memory model is trying to address. This will help people who are trying to evaluate the model. Some possible goals we've discussed are

  • No "quantum death" values
  • No "out of thin air" values
  • Provable "correctness"

Thanks @jyasskin for the suggestion

@lars-t-hansen
Copy link
Collaborator

OK. I agree it would be useful to summarize this, but I also don't think the spec is the right place for it (I'm a little self-conscious that the proposal already has a lot of expository text).

There is an existing document in this repo, DISCUSSION.md, that's intended for things like that. I'll see if it's possible to add something there, or I can create a new file for it if it becomes too large.

@lars-t-hansen lars-t-hansen modified the milestone: Stage 3 Jul 13, 2016
@jyasskin
Copy link

Specifically, I want to be able to call in external experts (like the http://www.cl.cam.ac.uk/~pes20/weakmemory/ group) to review the model and check that it implements your intent. To do that, they'll need to understand your intent. A file outside of the spec is totally fine for that.

@lars-t-hansen
Copy link
Collaborator

@jyasskin, noted. Also see Issue #88, in which @jfbastien is going for something similar.

It looks like "intent" won't be too voluminous, so it'll show up in DISCUSSION.md probably tomorrow, I'll make a note here when it does.

@lars-t-hansen
Copy link
Collaborator

I landed an expanded discussion (sections "Data Races" and "A summary of constraints on the memory model") that speaks to intent, though I expect it is probably still not enough for serious work. I'm going to leave this ticket open for a while, please do comment when you find that something is mystifying / missing / not to your liking. (Removing the milestone though - what's there is probably OK for stage 3.)

@lars-t-hansen lars-t-hansen removed this from the Stage 3 milestone Jul 19, 2016
@lars-t-hansen
Copy link
Collaborator

Another concern that was brought up is compatibility with WebAssembly, as discussed in Issue #59. I have summarized the discussion in that bug and added it as a subsection to DISCUSSION.md.

@lars-t-hansen
Copy link
Collaborator

Scanning the list of closed Stage 3 issues, I find these concerns listed:

I will address all of those in DISCUSSION.md (to the extent they are not already addressed), but briefly:

  • Clearly data races "affect" the semantics of racy programs, but that's not the concern here - this is more about quantum garbage and thin-air values. These effects are addressed in the spec and in DISCUSSION.md.
  • Races no longer result in garbage, but in some combination of the bytes that go into the race, so this is addressed.
  • The intent of the spec is that DRF programs should not be transformed to introduce observable races, but I'll need to go over the spec text again to see if that's properly restricted.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants