-
Notifications
You must be signed in to change notification settings - Fork 54
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
Remove buffer waiting condition #305
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #305 +/- ##
==========================================
+ Coverage 83.08% 83.20% +0.11%
==========================================
Files 39 39
Lines 2726 2721 -5
==========================================
- Hits 2265 2264 -1
+ Misses 335 332 -3
+ Partials 126 125 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
fb7d126
to
933f88b
Compare
Confirmed with this change it fixes #299 when running |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the goal was to reduce the overhead from writing when there is no pending read but the state gets mangled if there is more than one reader. i mistakenly assumed there was no use case for concurrent reading. it's probably possible to implement this with a counter instead of a bool but it's not critical...
933f88b
to
7fee991
Compare
I'll give the counter some short thought! |
Buffer's usage of
waiting
causes a scenario where if two reads come in while a write is happening can cause waiting to be stuck in false and all write "signals" will be dropped. After reading through the code, I can't figure out why the waiting condition is necessary; the worst thing I can imagine is we don't send to the buffered channel as often.Fixes #299