Koichi Sasada <ko1 / atdot.net> wrote:
> On 2018/01/25 7:01, Eric Wong wrote:
> >For everything else that serves multiple clients in a single
> >process, fair sharing is preferable.
> 
> Could you elaborate more? Generally, fairness is preferable. But I think we
> can document "we don't guarantee fairness scheduling on this feature",
> because our motivation is to provide a way to process multiple connections.
> Thoughts?

If I write a multi-process server with many long-lived
connections, it's best to balance those connections to mitigate
bottlenecks/problems which exist in each process.  That way, any
slowdown or crash which affects one process only affects
its fair subset of connections.

This is fair sharing across different *nix processes...
Within each process, Threadlets are also round-robin scheduled,
but run until they cannot proceed.

> Or dose it cause live-lock? (no-problem on server-client apps, but
> multi-agents programs seems to cause live locking)

It should not, Threadlet is FIFO for "ready" Fibers;
epoll and kqueue are readiness queues are FIFO internally, too.

Blocking accept() mitigates live-lock/thundering herd across
different processes.  For non-blocking accept(), I will add
EPOLLEXCLUSIVE support.

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>