Yes, it is not supposed to be possible for read() to block when select (or poll) has reaturned that data is available.
I can only see two situations that can cause that:
1> The socket is available in two different processes, and the other process gets there first.
2> We actually call read twice from this process, either by using threads, or because the FD is present twice in the fd-set (or list of pollfds), or perhaps OOB-data is read separately, causing this problem?
/ Per Hedbor ()
Previous text:
2003-03-19 14:31: Subject: I/O callbacks in blocking mode
We've seen it block on the line
string s=::read(8192,1);
in __stdio_read_callback.
So you mean the only situation when that can happen is if some other thread has managed to make a read before it? Then the real problem is probably that the read doesn't take place on the C level while the interpreter lock is held. What about moving all the stuff done in the pike level callbacks into Stdio.Fd, so that we can do away with them completely?
/ Martin Stjernholm, Roxen IS