runtime: add network polling support into scheduler
This is a part of the bigger change that moves network poller into runtime:
https://codereview.appspot.com/7326051/
https://codereview.appspot.com/7448048/diff/10001/src/pkg/runtime/netpoll.c File src/pkg/runtime/netpoll.c (right): https://codereview.appspot.com/7448048/diff/10001/src/pkg/runtime/netpoll.c#newcode8 src/pkg/runtime/netpoll.c:8: // returns list of goroutines that become runnable full ...
11 years, 1 month ago
(2013-03-05 09:06:27 UTC)
#6
https://codereview.appspot.com/7448048/diff/3/src/pkg/runtime/proc.c File src/pkg/runtime/proc.c (right): https://codereview.appspot.com/7448048/diff/3/src/pkg/runtime/proc.c#newcode1003 src/pkg/runtime/proc.c:1003: gp = runtime·netpoll(0, 8); // non-blocking On 2013/03/05 08:31:57, ...
11 years, 1 month ago
(2013-03-05 15:48:45 UTC)
#9
https://codereview.appspot.com/7448048/diff/3/src/pkg/runtime/proc.c
File src/pkg/runtime/proc.c (right):
https://codereview.appspot.com/7448048/diff/3/src/pkg/runtime/proc.c#newcode1003
src/pkg/runtime/proc.c:1003: gp = runtime·netpoll(0, 8); // non-blocking
On 2013/03/05 08:31:57, dvyukov wrote:
> On 2013/03/04 21:50:30, bradfitz wrote:
> > why 8?
>
> Good question. It used to be in slightly different place, and the idea was
that
> worker threads can get small pieces of work from netpoll() independently. But
in
> this place it won't work that way.
> I've changed netpoll to accept just a single parameter - bool dontblock.
> PTAL.
Fewer parameters works for me. Is it common in this code to name boo parameters
starting with "dont"? The negative reads confusingly, but I don't care much.
11 years, 1 month ago
(2013-03-07 13:15:52 UTC)
#11
On 2013/03/05 15:48:45, bradfitz wrote:
> https://codereview.appspot.com/7448048/diff/3/src/pkg/runtime/proc.c
> File src/pkg/runtime/proc.c (right):
>
>
https://codereview.appspot.com/7448048/diff/3/src/pkg/runtime/proc.c#newcode1003
> src/pkg/runtime/proc.c:1003: gp = runtime·netpoll(0, 8); // non-blocking
> On 2013/03/05 08:31:57, dvyukov wrote:
> > On 2013/03/04 21:50:30, bradfitz wrote:
> > > why 8?
> >
> > Good question. It used to be in slightly different place, and the idea was
> that
> > worker threads can get small pieces of work from netpoll() independently.
But
> in
> > this place it won't work that way.
> > I've changed netpoll to accept just a single parameter - bool dontblock.
> > PTAL.
>
> Fewer parameters works for me. Is it common in this code to name boo
parameters
> starting with "dont"? The negative reads confusingly, but I don't care much.
Renamed to 'bool block'
I've also renamed netpoll.c to netpoll0.c, because it's intended for platforms that do not support ...
11 years, 1 month ago
(2013-03-07 13:16:46 UTC)
#12
I've also renamed netpoll.c to netpoll0.c, because it's intended for platforms
that do not support the poller, and netpoll.c will contain common code for
platforms that do support the poller.
PTAL
On Tue, Mar 12, 2013 at 12:22 PM, Dmitry Vyukov <dvyukov@google.com> wrote: > On Tue, ...
11 years, 1 month ago
(2013-03-12 16:28:00 UTC)
#18
On Tue, Mar 12, 2013 at 12:22 PM, Dmitry Vyukov <dvyukov@google.com> wrote:
> On Tue, Mar 12, 2013 at 8:03 PM, <rsc@golang.org> wrote:
> > LGTM
> >
> >
> >
> >
> https://codereview.appspot.com/7448048/diff/31001/src/pkg/runtime/netpoll0.c
> > File src/pkg/runtime/netpoll0.c (right):
> >
> >
>
https://codereview.appspot.com/7448048/diff/31001/src/pkg/runtime/netpoll0.c#...
> > src/pkg/runtime/netpoll0.c:12: runtime·netpoll(bool block)
> > Can you perhaps call this file netpoll_stub.c?
>
> will do
>
> > The 0 suffix is a bit magical (I already regret mgc0.c and that's a
> > completely different 0).
>
> and what is that 0? :)
>
It was step 0 of my multi-step plan for writing a garbage collector. I
never changed the file name as the work progressed (and the work went off
in a different direction anyway).
On 2013/03/12 16:28:00, rsc wrote: > On Tue, Mar 12, 2013 at 12:22 PM, Dmitry ...
11 years, 1 month ago
(2013-03-12 17:14:12 UTC)
#19
On 2013/03/12 16:28:00, rsc wrote:
> On Tue, Mar 12, 2013 at 12:22 PM, Dmitry Vyukov <mailto:dvyukov@google.com>
wrote:
>
> > On Tue, Mar 12, 2013 at 8:03 PM, <mailto:rsc@golang.org> wrote:
> > > LGTM
> > >
> > >
> > >
> > >
> > https://codereview.appspot.com/7448048/diff/31001/src/pkg/runtime/netpoll0.c
> > > File src/pkg/runtime/netpoll0.c (right):
> > >
> > >
> >
>
https://codereview.appspot.com/7448048/diff/31001/src/pkg/runtime/netpoll0.c#...
> > > src/pkg/runtime/netpoll0.c:12: runtime·netpoll(bool block)
> > > Can you perhaps call this file netpoll_stub.c?
> >
> > will do
> >
> > > The 0 suffix is a bit magical (I already regret mgc0.c and that's a
> > > completely different 0).
> >
> > and what is that 0? :)
> >
>
> It was step 0 of my multi-step plan for writing a garbage collector. I
> never changed the file name as the work progressed (and the work went off
> in a different direction anyway).
All done
Issue 7448048: code review 7448048: runtime: add network polling support into scheduler
(Closed)
Created 11 years, 1 month ago by dvyukov
Modified 11 years, 1 month ago
Reviewers: 0xe2.0x9a.0x9b_gmail.com
Base URL:
Comments: 9