accept: do not set blocking if non-blocking is set
commitc751f42f5f6a5e54a399df472015ab6d2ffc3f7a
authorEric Wong <normalperson@yhbt.net>
Sun, 30 Dec 2012 11:43:10 +0000 (30 11:43 +0000)
committerEric Wong <normalperson@yhbt.net>
Sun, 30 Dec 2012 11:43:10 +0000 (30 11:43 +0000)
tree91335335f49899437bb10c17a106ec5cb8fdf323
parentc63ad2b2e0e25f0765605e8ba2d7038b5e28d878
accept: do not set blocking if non-blocking is set

This is prone to race conditions in multiprocess situations
where one process is relying on non-blocking operation while
another (likely newer process) relies on blocking operation.

Since the blocking process can always fall back to calling
rb_io_wait_readable(), use that instead and give up some
scalability for higher reliability.

Those interested in avoiding thundering herds will have to
stop/start their processes using blocking sockets (and tolerate
some downtime).
ext/kgio/accept.c