preliminary implementation of "smart_nopush"
commit910f6f3df099c04fcd55bd6b20785cce69cb36ae
authorEric Wong <normalperson@yhbt.net>
Fri, 28 Jan 2011 03:43:39 +0000 (27 19:43 -0800)
committerEric Wong <normalperson@yhbt.net>
Fri, 28 Jan 2011 03:45:52 +0000 (27 19:45 -0800)
tree4cc051bc7155b0b655a44fa19666a8870c5ece49
parentec91ac3d8c8d9236ba0cd01794c9c4a3ee3f7eeb
preliminary implementation of "smart_nopush"

It only supports TCP_CORK under Linux right now.

We use a very basic strategy to use TCP_CORK semantics optimally
in most TCP servers:  On corked sockets, we will uncork on recv()
if there was a previous send().  Otherwise we do not fiddle
with TCP_CORK at all.

Under Linux, we can rely on TCP_CORK being inherited in an
accept()-ed client socket so we can avoid syscalls for each
accept()-ed client if we already know the accept() socket corks.

This module does NOTHING for client TCP sockets, we only deal
with accept()-ed sockets right now.
ext/kgio/accept.c
ext/kgio/kgio.h
ext/kgio/kgio_ext.c
ext/kgio/nopush.c [new file with mode: 0644]
ext/kgio/read_write.c
kgio.gemspec
test/test_nopush_smart.rb [new file with mode: 0644]