Save one fcntl() syscall on every request
commit96c73021c7b41d609fb8335d0ef986ed16bd2dc3
authorEric Wong <normalperson@yhbt.net>
Mon, 13 Apr 2009 05:59:03 +0000 (12 22:59 -0700)
committerEric Wong <normalperson@yhbt.net>
Mon, 13 Apr 2009 05:59:03 +0000 (12 22:59 -0700)
treedd01ba672b9ac03fb9f58480cb5098bdbc4ba9e5
parentfc4bd6c542b6556e746baee5aecadfcd1a591beb
Save one fcntl() syscall on every request

MRI 1.8 always sets O_NONBLOCK on sockets to implement green
threads correctly in the face of slow network I/O.  Since we
already know what the I/O flags for a client socket should be,
we just set it to that instead.

Applications running on Unicorn continue to be green thread-safe
when used fast local traffic.  Of course, Unicorn itself will
never use threads.
lib/unicorn.rb
lib/unicorn/socket.rb