Re: [go-nuts] CPU fairness in goroutine scheuding

2016-06-17 Thread Sam Whited
On Fri, Jun 17, 2016 at 2:23 PM, Dmitry Orlov wrote: > If I understand it correctly, go scheduler instruments code with additional > yield points not related to I/O. That can help fairness too. It will sometimes pre-empt on function calls, but this can get a bit hairy since you can't always be su

Re: [go-nuts] CPU fairness in goroutine scheuding

2016-06-17 Thread Dmitry Orlov
Thanks Ian, On Thu, Jun 16, 2016 at 12:13 PM, Ian Lance Taylor wrote: > On Thu, Jun 16, 2016 at 11:27 AM, Dmitry Orlov > wrote: > > > > I am curious how does goroutine scheduler picks what goroutine to run, > among > > several runnable. Does it optimize for fairness in any way? > > The current

Re: [go-nuts] CPU fairness in goroutine scheuding

2016-06-16 Thread Ian Lance Taylor
On Thu, Jun 16, 2016 at 11:27 AM, Dmitry Orlov wrote: > > I am curious how does goroutine scheduler picks what goroutine to run, among > several runnable. Does it optimize for fairness in any way? The current scheduler does not optimize for fairness. Of course, the scheduler has changed in the p

[go-nuts] CPU fairness in goroutine scheuding

2016-06-16 Thread Dmitry Orlov
Hello golang experts, I am curious how does goroutine scheduler picks what goroutine to run, among several runnable. Does it optimize for fairness in any way? I ran a quick experiment and found out that goroutines that run for longer intervals between yield points receive proportionally larger