FAQ
Reviewers: rsc, dvyukov, mikio, brainman,

Message:
Hello rsc@golang.org, dvyukov@google.com, mikioh.mikioh@gmail.com,
alex.brainman@gmail.com (cc: golang-dev@googlegroups.com,
remyoudompheng@gmail.com),

I'd like you to review this change to
https://code.google.com/p/go


Description:
net: fix data races on deadline vars

Fixes issue 4434.

This proposal replaces the previous CL 6855110. Due to issue 599, 64-bit
atomic operations should probably be avoided, so use a sync.Mutex
instead.

Benchmark comparisons against 025b9d070a85 on linux/386:

CL 6855110:

benchmark old ns/op new ns/op delta
BenchmarkTCPOneShot 710024 727409 +2.45%
BenchmarkTCPOneShotTimeout 758178 768620 +1.38%
BenchmarkTCPPersistent 223464 228058 +2.06%
BenchmarkTCPPersistentTimeout 234494 242600 +3.46%

This proposal:

benchmark old ns/op new ns/op delta
BenchmarkTCPOneShot 710024 718492 +1.19%
BenchmarkTCPOneShotTimeout 758178 748783 -1.24%
BenchmarkTCPPersistent 223464 227628 +1.86%
BenchmarkTCPPersistentTimeout 234494 238321 +1.63%

Please review this at https://codereview.appspot.com/6866050/

Affected files:
A src/pkg/net/fd_posix_test.go
M src/pkg/net/fd_windows.go
M src/pkg/net/sendfile_freebsd.go
M src/pkg/net/sendfile_linux.go
M src/pkg/net/sock_posix.go
M src/pkg/net/sockopt_posix.go

Search Discussions

  • Bradfitz at Dec 4, 2012 at 2:41 pm
    LGTM



    https://codereview.appspot.com/6866050/diff/7007/src/pkg/net/fd_windows.go
    File src/pkg/net/fd_windows.go (right):

    https://codereview.appspot.com/6866050/diff/7007/src/pkg/net/fd_windows.go#newcode299
    src/pkg/net/fd_windows.go:299: // TODO(dfc,brainman) when we get a
    windows race builder, revisit this.
    or err on the other side: make this code the same as POSIX for now, and
    see if it could be made faster later.

    either way.

    https://codereview.appspot.com/6866050/
  • Dvyukov at Dec 4, 2012 at 2:48 pm
    https://codereview.appspot.com/6866050/diff/7007/src/pkg/net/fd_windows.go
    File src/pkg/net/fd_windows.go (right):

    https://codereview.appspot.com/6866050/diff/7007/src/pkg/net/fd_windows.go#newcode299
    src/pkg/net/fd_windows.go:299: // TODO(dfc,brainman) when we get a
    windows race builder, revisit this.
    On 2012/12/04 14:41:34, bradfitz wrote:
    or err on the other side: make this code the same as POSIX for now,
    and see if
    it could be made faster later.
    either way.
    Note that it's not about our race builders. It's about user programs.
    It's very unpleasant when all your bots are read because of a bug in std
    lib that can be fixed only in several months.

    https://codereview.appspot.com/6866050/

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedDec 4, '12 at 11:46a
activeDec 4, '12 at 2:48p
posts3
users3
websitegolang.org

3 users in discussion

Dave: 1 post Dvyukov: 1 post Bradfitz: 1 post

People

Translate

site design / logo © 2022 Grokbase