Maybe you could investigate something like this:
https://www.snellman.net/blog/archive/2016-07-27-ratas-hierarchical-timer-wheel/
Disclaimer: I've not tried that method, but I saw it recently and filed it away
as potentially useful
-- Ian
On Thu, Aug 4, 2016, at 11:14 AM, pi wrote:
> You mean
You mean something like this?
func (b *RingBuf) ReadWait(min uint32, timeout time.Duration) bool {
if min == 0 {
min = 1
}
if b.ReadAvail() >= min {
return true
}
if timeout.Nanoseconds() == 0 {
return false
}
const pollPeriod = 100 *
I think it would be cheaper to call time.Sleep than spinning on runtime.Gosched.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to