about summary refs log tree commit homepage
path: root/lib/rainbows/dev_fd_response.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-12-21 16:31:28 -0800
committerEric Wong <normalperson@yhbt.net>2009-12-21 16:31:28 -0800
commitee7fe220ccbc991e1e7cbe982caf48e3303274c7 (patch)
tree8e735cac5a514ae0d48a877dc62c68b68a5506dc /lib/rainbows/dev_fd_response.rb
parente962d665c1e27de8d930c3acc51502fa4d147532 (diff)
downloadrainbows-ee7fe220ccbc991e1e7cbe982caf48e3303274c7.tar.gz
Under MRI 1.8, listen sockets do not appear to have the
nonblocking I/O flag on by default, nor does it set the
nonblocking I/O flag when calling #accept (but it does
when using #accept_nonblock, of course).

Normally this is not a problem even when using green threads
since MRI will internally select(2) on the file descriptor
before attempting a blocking (and immediately successful)
accept(2).

However, when sharing a listen descriptor across multiple
processes, spurious wakeups are likely to occur, causing
multiple processes may be woken up when a single client
connects.

This causes a problem because accept(2)-ing on multiple
threads/processes for a single connection causes blocking accepts in
multiple processes, leading to stalled green threads.

This is not an issue under 1.9 where a blocking accept() call
unlocks the GVL to let other threads run.
Diffstat (limited to 'lib/rainbows/dev_fd_response.rb')
0 files changed, 0 insertions, 0 deletions