FAQ
Reviewers: dvyukov,

Message:
Hello [email protected] (cc: [email protected]),

I'd like you to review this change to
https://go.googlecode.com/hg/


Description:
net: separate unix pollster initialization from network file descriptor
allocation

This is in preparation for runtime-integrated network pollster for BSD
variants.

Update issue 5199

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

Affected files:
    M src/pkg/net/fd_poll_unix.go


Index: src/pkg/net/fd_poll_unix.go
===================================================================
--- a/src/pkg/net/fd_poll_unix.go
+++ b/src/pkg/net/fd_poll_unix.go
@@ -252,14 +252,23 @@
   }

   func (pd *pollDesc) Lock() {
+ if pd.pollServer == nil {
+ return
+ }
    pd.pollServer.Lock()
   }

   func (pd *pollDesc) Unlock() {
+ if pd.pollServer == nil {
+ return
+ }
    pd.pollServer.Unlock()
   }

   func (pd *pollDesc) Wakeup() {
+ if pd.pollServer == nil {
+ return
+ }
    pd.pollServer.Wakeup()
   }

@@ -294,6 +303,9 @@
   }

   func (pd *pollDesc) Evict() bool {
+ if pd.pollServer == nil {
+ return false
+ }
    return pd.pollServer.Evict(pd)
   }



--

---
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Brad Fitzpatrick at Aug 8, 2013 at 9:27 pm
    Who is calling these methods when they don't have pollServers?


    On Thu, Aug 8, 2013 at 1:49 PM, wrote:

    Reviewers: dvyukov,

    Message:
    Hello [email protected] (cc: [email protected]),

    I'd like you to review this change to
    https://go.googlecode.com/hg/


    Description:
    net: separate unix pollster initialization from network file descriptor
    allocation

    This is in preparation for runtime-integrated network pollster for BSD
    variants.

    Update issue 5199

    Please review this at https://codereview.appspot.**com/12663043/<https://codereview.appspot.com/12663043/>

    Affected files:
    M src/pkg/net/fd_poll_unix.go


    Index: src/pkg/net/fd_poll_unix.go
    ==============================**==============================**=======
    --- a/src/pkg/net/fd_poll_unix.go
    +++ b/src/pkg/net/fd_poll_unix.go
    @@ -252,14 +252,23 @@
    }

    func (pd *pollDesc) Lock() {
    + if pd.pollServer == nil {
    + return
    + }
    pd.pollServer.Lock()
    }

    func (pd *pollDesc) Unlock() {
    + if pd.pollServer == nil {
    + return
    + }
    pd.pollServer.Unlock()
    }

    func (pd *pollDesc) Wakeup() {
    + if pd.pollServer == nil {
    + return
    + }
    pd.pollServer.Wakeup()
    }

    @@ -294,6 +303,9 @@
    }

    func (pd *pollDesc) Evict() bool {
    + if pd.pollServer == nil {
    + return false
    + }
    return pd.pollServer.Evict(pd)
    }



    --

    ---You received this message because you are subscribed to the Google
    Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-dev+unsubscribe@**googlegroups.com<golang-dev%[email protected]>
    .
    For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
    .

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
    For more options, visit https://groups.google.com/groups/opt_out.
  • Mikio Hara at Aug 8, 2013 at 10:09 pm

    On Fri, Aug 9, 2013 at 6:27 AM, Brad Fitzpatrick wrote:

    Who is calling these methods when they don't have pollServers?
    After rearranging the call oder of pollster and syscall functions it
    will happen.
    Updated the CL description.

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
    For more options, visit https://groups.google.com/groups/opt_out.
  • Dvyukov at Aug 8, 2013 at 9:41 pm
    When you switch to runtime netpoll, you will delete fd_poll_unix.go. So
    why do we need to modify it now?


    https://codereview.appspot.com/12663043/

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
    For more options, visit https://groups.google.com/groups/opt_out.
  • Mikio Hara at Aug 8, 2013 at 10:01 pm

    On Fri, Aug 9, 2013 at 6:41 AM, wrote:

    When you switch to runtime netpoll, you will delete fd_poll_unix.go. So
    why do we need to modify it now?
    I don't think it will happen at the same time.

    - rearranging the call order of pollster and syscall functions w/ old
    unix pollster
    - switching from unix pollster to runtime-integrated pollster

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
    For more options, visit https://groups.google.com/groups/opt_out.
  • Dvyukov at Aug 8, 2013 at 10:28 pm
    LGTM
    I think I understand what happens


    https://codereview.appspot.com/12663043/

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
    For more options, visit https://groups.google.com/groups/opt_out.
  • Mikioh Mikioh at Aug 9, 2013 at 12:03 am
    *** Submitted as
    https://code.google.com/p/go/source/detail?r=333a1fab08e7 ***

    net: separate unix pollster initialization from network file descriptor
    allocation

    Unlike the existing net package own pollster, runtime-integrated
    network pollster on BSD variants, actually kqueue, requires a socket
    that has beed passed to syscall.Listen previously for a stream
    listener.

    This CL separates pollDesc.Init of Unix network pollster from newFD
    to avoid any breakages in the transition from Unix network pollster
    to runtime-integrated pollster. Upcoming CLs will rearrange the call
    order of pollster and syscall functions like the following;

    - For dialers that open active connections, pollDesc.Init will be
        called in between syscall.Bind and syscall.Connect.

    - For stream listeners that open passive stream connections,
        pollDesc.Init will be called just after syscall.Listen.

    - For datagram listeners that open datagram connections,
        pollDesc.Init will be called just after syscall.Bind.

    This is in preparation for runtime-integrated network pollster for BSD
    variants.

    Update issue 5199

    R=dvyukov, bradfitz
    CC=golang-dev
    https://codereview.appspot.com/12663043


    https://codereview.appspot.com/12663043/

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedAug 8, '13 at 8:49p
activeAug 9, '13 at 12:03a
posts7
users3
websitegolang.org

People

Translate

site design / logo © 2023 Grokbase