From: Eric Wong Date: 2018-01-28T20:00:14+00:00 Subject: [ruby-core:85189] Re: [Ruby trunk Feature#13618][Assigned] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid Koichi Sasada 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: