about summary refs log tree commit homepage
path: root/lib/yahns/config.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-10-31 04:49:22 +0000
committerEric Wong <normalperson@yhbt.net>2013-10-31 04:49:22 +0000
commitbfe699496ced8f73f659da0f0857fda614fb40b6 (patch)
treecc10c8afcdc4d3baab142a4b5181b7c9ae75087e /lib/yahns/config.rb
parentb4e8651a50733f256c065e576c2d9198c3911532 (diff)
downloadyahns-bfe699496ced8f73f659da0f0857fda614fb40b6.tar.gz
With a GVL-free Ruby implementation, the following situation
may occur as FDs are recycled frequently with 3 threads
running:

expiry                 | normal    | acceptor
-----------------------+-----------+----------------------
yahns_expire(fd).enter |           |
                       | close(fd) |
                       |           | accept().return => fd
shutdown(fd) - WRONG   |           |
-----------------------+-----------+----------------------

So we must prevent expiry from running while another thread
is closing, otherwise there is a small chance a lack of
lock inside the Ruby implementation itself can lead to a
mis-issued close() to a fast-recycled FD.
Diffstat (limited to 'lib/yahns/config.rb')
0 files changed, 0 insertions, 0 deletions