From: Eric Wong Date: 2011-08-02T08:14:52+09:00 Subject: [ruby-core:38671] Re: [Ruby 1.9 - Bug #5138][Open] Add nonblocking IO that does not use exceptions for EOF and EWOULDBLOCK Urabe Shyouhei wrote: > So when you do a read loop, nothing bothers you, as long as you use > readpartial. That use of select + readpartial is unsafe. Spurious wakeup is a documented behavior of the select() system call, data can be received but checksums can be incorrect and data is discarded (after process is woken up from select()). Calling IO#nread (from io/wait) before IO#readpartial /may/ be OK, but I'm not sure how portable that is. -- Eric Wong