This commit is contained in:
Derek Collison
2015-08-23 13:40:35 -07:00
parent e8d736ebe0
commit ffa21f3736
2 changed files with 11 additions and 3 deletions

View File

@@ -5,8 +5,8 @@
- [ ] Pedantic state
- [ ] brew, apt-get, rpm, chocately (windows)
- [ ] Dynamic socket buffer sizes
- [ ] Switch to 1.4 and use maps vs hashmaps in sublist
- [ ] Sublist better at high concurrency
- [ ] Switch to 1.4/1.5 and use maps vs hashmaps in sublist
- [ ] Sublist better at high concurrency, cache uses writelock currently
- [ ] Buffer pools/sync pools?
- [ ] IOVec pools and writev for high fanout?
- [ ] Add ability to reload config on signal

View File

@@ -53,7 +53,15 @@ func (d ByPending) Swap(i, j int) {
d[i], d[j] = d[j], d[i]
}
func (d ByPending) Less(i, j int) bool {
return d[i].Val.bw.Buffered() < d[j].Val.bw.Buffered()
client := d[i].Val
client.mu.Lock()
bwi := client.bw.Buffered()
client.mu.Unlock()
client = d[j].Val
client.mu.Lock()
bwj := client.bw.Buffered()
client.mu.Unlock()
return bwi < bwj
}
type ByOutMsgs []Pair