Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update FAQ: Shared does not cause memory barriers #1570

Merged
merged 1 commit into from
Feb 15, 2017

Conversation

jpf91
Copy link
Contributor

@jpf91 jpf91 commented Feb 14, 2017

There's been a question about this in D.learn recently:
http://forum.dlang.org/post/apoqhsoqksuwieklcnjj@forum.dlang.org

If I remember correctly the final decision from 2012 was that shared variables do not automatically cause any memory barriers, but we never documented this:
http://forum.dlang.org/post/k7pn19$bre$1@digitalmars.com
http://forum.dlang.org/post/mailman.1904.1352922666.5162.digitalmars-d@puremagic.com

ping @WalterBright @andralex

@andralex
Copy link
Member

I think we need to revisit this.

@JackStouffer
Copy link
Member

@andralex I think shared needs to be revisited ;)

@d-random-contributor
Copy link

Hmm... was it initially meant so? Some people wanted it, but I don't think the compiler itself was meant to do it. Do you mean Bartosz proposal here?

@jpf91
Copy link
Contributor Author

jpf91 commented Feb 15, 2017

Hmm... was it initially meant so? Some people wanted it, but I don't think the compiler itself was meant to do it.

The FAQ entry changed by this pull request is currently:

Reading/writing shared data emits memory barriers to ensure sequential consistency (not implemented)

This is also mentioned in TDPL, chapter 13.12.1 Sequential consistency of shared data:

[...] To effect that, shared accesses must be surrounded by special machine code instructions called memory barriers, [...]

The discussion linked in the pull request description is more recent than TDPL though:
http://forum.dlang.org/post/k7pn19$bre$1@digitalmars.com

@andralex
Copy link
Member

I think we made a mistake in the forum discussion. For now let's update this PR by making it state the current state of affairs: "Currently the compiler does not insert memory barriers around shared variables." Also please open a bugzilla issue to revisit this. Thanks.

@d-random-contributor
Copy link

d-random-contributor commented Feb 15, 2017

Related issues are 14932 and 16198

@jpf91
Copy link
Contributor Author

jpf91 commented Feb 15, 2017

For now let's update this PR by making it state the current state of affairs:

Done.

Also please open a bugzilla issue to revisit this.

Do we need another issues or can we use 14932 and 16198 for this?

@JackStouffer
Copy link
Member

JackStouffer commented Feb 15, 2017

I think 14932 suffices ;)

@andralex
Copy link
Member

OK we're good with bugzilla. Thanks.

@andralex andralex merged commit 3d9c395 into dlang:master Feb 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants