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

Should Reader move last? #45

Open
jamesmunns opened this issue Dec 8, 2019 · 0 comments
Open

Should Reader move last? #45

jamesmunns opened this issue Dec 8, 2019 · 0 comments

Comments

@jamesmunns
Copy link
Owner

jamesmunns commented Dec 8, 2019

This comment from initial implementation states that Reader should be in charge of moving last back to max when necessary. See this comment

However in my current implementation, I move the last pointer when the Writer commits a grant past the last position. I'm not sure when this changed. This still seems sound, as the following scenarios are all good:

  1. read < write < last
    • OK: Reader will be blocked by writer
  2. write < read < last
    • OK: Reader will be blocked by last, then will jump back to 0, where it will be back in case 1

I should probably make sure that the ordering of these transactions are still good though, and either update the code, or update the comments

CC @utaal, I need to see what his spsc buffer does in this case

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

No branches or pull requests

1 participant