-
Notifications
You must be signed in to change notification settings - Fork 56
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
Use sync.Cond for packetio.Buffer #307
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #307 +/- ##
==========================================
+ Coverage 83.12% 83.22% +0.10%
==========================================
Files 39 39
Lines 2720 2737 +17
==========================================
+ Hits 2261 2278 +17
+ Misses 334 333 -1
- Partials 125 126 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
2d1258f
to
ad473a0
Compare
@paulwe after sleeping on it, I think I prefer what we landed on last night, sticking to channels. If needed in the future, it will allow us to use context as well pretty easily which would be harder to slot into this solution. However based on your comments on #304, I’m curious what reasoning has changed to go back in the direction of sync.Cond? Maybe I’m not seeing some other added benefit! |
in #304 we were using a combination of cond and channels and using a background goroutine to synchronize them. i was concerned about the complexity and possible fragility of that approach. i don't have a preference for one or the other i just think we should pick one. i wrote this because you expressed a preference for cond and it occurred to me that we could make it work if we abstracted the timer utility out of the deadline helper. the channel based version is marginally faster for concurrent r/w benchmarks
vs
|
Yeah FWIW your solution is a lot cleaner than my spawning an extra goroutine which felt ugly. If the benchmark was significantly in favor sync.Cond, I'd say we should use it. Thank you for exploring this! |
No description provided.