[ruby-core:108320] Re: [Ruby master Feature#18668] Merge `io-nonblock` gems into core
From:
Eric Wong <normalperson@...>
Date:
2022-04-20 19:14:36 UTC
List:
ruby-core #108320
"Eregon (Benoit Daloze)" <[email protected]> wrote: > Issue #18668 has been updated by Eregon (Benoit Daloze). > > mame (Yusuke Endoh) wrote in #note-11: > > I think we may set O_NONBLOCK to all file descriptors by default. > IIRC there were issues with that, notably when @normalperson > tried it a while ago. @ioquatix might know more. > stdstreams/File seem nonblock?=false currently, and > socket/pipe seem nonblock?=true currently. nonblock=true as default is still risky to me. I tried it years ago but the compatibility problems w.r.t. FD sharing (send_io, exec) to non-Ruby programs put me off. AFAIK there were also problems on the Windows side and I don't touch proprietary. > Also, maybe O_NONBLOCK by default is actually slower for IO > (without a Fiber scheduler)? It will typically cause more > syscalls, isn't it? Yes, nonblock is slightly slower in terms of raw throughput for a single endpoint (which the rare case). Nonblock makes sense for the common case of multiple connections or the normal Internet case when you have latency and bandwidth limitations. Unsubscribe: <mailto:[email protected]?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>