Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(899)

Issue 4275042: code review 4275042: net: don't loop to drain wakeup pipe. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years ago by iant
Modified:
14 years ago
Reviewers:
bradfitzgoog, dave
CC:
rsc, golang-dev
Visibility:
Public.

Description

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.

Patch Set 1 #

Patch Set 2 : diff -r 38937f4e4d1f https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -4 lines) Patch
M src/pkg/net/fd.go View 1 chunk +4 lines, -4 lines 0 comments Download

Messages

Total messages: 5
iant
Hello rsc (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
14 years ago (2011-03-12 01:26:06 UTC) #1
rsc
LGTM I have been meaning to find out whether you can add events to a ...
14 years ago (2011-03-12 01:47:51 UTC) #2
iant
*** Submitted as http://code.google.com/p/go/source/detail?r=6b93721889f3 *** net: don't loop to drain wakeup pipe. The loop always ...
14 years ago (2011-03-12 02:01:34 UTC) #3
bradfitzgoog
For epoll the answer is yes. (phone), brad On Mar 11, 2011 5:48 PM, "Russ ...
14 years ago (2011-03-12 02:04:47 UTC) #4
dave_cheney.net
14 years ago (2011-03-12 03:47:06 UTC) #5
I believe that is also true for kqueue. 

Sent from my iPad

On 12/03/2011, at 13:04, Brad Fitzpatrick <bradfitz@google.com> wrote:

> For epoll the answer is yes.
> 
> (phone), brad
> 
> On Mar 11, 2011 5:48 PM, "Russ Cox" <rsc@golang.org> wrote:
> > LGTM
> > 
> > I have been meaning to find out whether you can add events
> > to a kqueue/epoll/whatever while another thread is sleeping on it.
> > That would eliminate the whole dance.
> > 
> > Russ
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b