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

3 buffers vs double buffer #56

Closed
romange opened this issue Oct 28, 2017 · 2 comments
Closed

3 buffers vs double buffer #56

romange opened this issue Oct 28, 2017 · 2 comments

Comments

@romange
Copy link

romange commented Oct 28, 2017

Hi Ben,

This is not really an issue, just a question. I've read your code (async part) and I noticed that you used 3 buffers: every time you complete the first buffer you copy the second to the beginning, wait for the last third to complete and then you copy it as well . What's the reason for this design?
Why not using just double-buffer technique: parse from the first part while asynchronously read into the second half, wait for it to complete and then to parse the second part, asynchronously reading from the first part. It seems simpler so I am guessing there is a catch.

@ben-strasser
Copy link
Owner

ben-strasser commented Oct 28, 2017 via email

@romange
Copy link
Author

romange commented Oct 29, 2017

Thanks! That explains it 👍

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

2 participants