select + write edge cases

Nicholas Clark nick at ccl4.org
Mon Jan 8 13:29:38 GMT 2007


On Mon, Jan 08, 2007 at 01:12:27PM +0000, Dirk Koopman wrote:

> I have a select handler working on (I try to set as) non blocking
> sockets ($sock->blocking(0)). I select on output (carefully enabling and

> However, it still manages to hang in __write_nocancel() (in my perl
> 5.8.8) on output when the operating system buffer for that socket.

> The impression I am getting is that, even when a queue is full, select
> may drop saying "output available" and then when I syswrite(), it hangs
> instead of returning 0.

Odd. If it's really a non blocking socket then surely that syswrite should
return EGAIN, even if the select has lied.

But (say) select and syswrite are both getting their "it's ready to write"
from the same source, and that source is lieing, then this behaviour is
consistent with that. But I've no idea if this happens.

What OS? (Not that this will really help me, but it might help others)


Nicholas Clark


More information about the london.pm mailing list