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

Improved handling of in-progress consumer buffer rotation and simplified peek of mpmc xadd q #262

Merged
merged 1 commit into from Nov 5, 2019

Conversation

franz1981
Copy link
Collaborator

@franz1981 franz1981 commented Sep 7, 2019

This PR include an alternative fix for #255 on a0bc103#diff-61853935c955f7d3dd424601f34d4ca1R583:
a pooled chunk element is considered "stable" right after its sequence is being written, so it can be read after winning the cas.

There are other improvements/fixes in this PR:

  1. an in-progress rotation doesn't prevent anymore racing consumers to return null from poll if q is empty: on a0bc103#diff-61853935c955f7d3dd424601f34d4ca1L528
  2. rotateConsumerBuffer is responsible to await next to be visible after winning the cas (on a0bc103#diff-61853935c955f7d3dd424601f34d4ca1R443) with no fear to get interruped by other consumers (on a0bc103#diff-61853935c955f7d3dd424601f34d4ca1L612)
  3. poll contains more comments to explain the covered cases
  4. peek has been simplified

NOTE: #265 could be solved by incorporating some of the changes on this PR

@coveralls
Copy link

coveralls commented Sep 7, 2019

Pull Request Test Coverage Report for Build 570

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 47.581%

Totals Coverage Status
Change from base Build 551: 0.0%
Covered Lines: 1672
Relevant Lines: 3514

💛 - Coveralls

@franz1981 franz1981 force-pushed the mpmc_poll_like branch 2 times, most recently from 7aa5fe9 to 42cbc91 Compare October 28, 2019 08:06
@franz1981 franz1981 changed the title MpmcArrayQueue-like poll for pooled AtomicChunks on mpmc xadd q Improved handling of in-progress consumer buffer rotation and simplified peek of mpmc xadd q Oct 28, 2019
@franz1981
Copy link
Collaborator Author

@nitsanw Now is ready to be reviewed

@nitsanw
Copy link
Contributor

nitsanw commented Nov 5, 2019

@franz1981 I'm going to merge the PRs for the Xadd queues are review the implementations from scratch before the release.

@nitsanw nitsanw merged commit fc29784 into JCTools:master Nov 5, 2019
@franz1981 franz1981 deleted the mpmc_poll_like branch November 5, 2019 13:56
@franz1981
Copy link
Collaborator Author

@nitsanw Bud, let me know if you need to chat about it (hangout or on github/gitter) to make it fast 👍

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.

None yet

3 participants