]> Cypherpunks repositories - gostls13.git/commit
net: don't loop to drain wakeup pipe.
authorIan Lance Taylor <iant@golang.org>
Sat, 12 Mar 2011 02:01:28 +0000 (18:01 -0800)
committerIan Lance Taylor <iant@golang.org>
Sat, 12 Mar 2011 02:01:28 +0000 (18:01 -0800)
commitc01238a571769f12a9c2bb971d26fe27c4158530
treef4668a465dbbace9a2748df5f94f5cf60b7a976e
parent5df1cf0475cd5b27601cfe95d94c5e4365f999f3
net: don't loop to drain wakeup pipe.

The loop always makes an extra system call.  It only makes a
difference if more than 100 goroutines started waiting for
something to happen on a network file descriptor since the
last time the pipe was drained, which is unlikely since we
will be woken up the first time a goroutine starts waiting.
If we don't drain the pipe this time, we'll be woken up again
right away and can drain again.

R=rsc
CC=golang-dev
https://golang.org/cl/4275042
src/pkg/net/fd.go