Paul Johnson wrote:
Recently, another thirty or so pipes have been added to this group and
very occassionally I am noticing a problem whereby select will indicate
that a pipe is ready for reading and sysread will attempt to read from
the pipe, but there is actually nothing there to be read, and so the
sysread call hangs waiting for input.
Could it be a deferred signal? See perldoc perlipc for more info.
From some code I wrote:
while (1) {
$client = $server->accept() || do {
# accept() can "fail" in Perl 5.7.3 and later thanks
# to "safe signals" which can interrupt an accept()
# so we detect this and ignore it
next if $!{EINTR};
last;
};
# handle $client request
}
It's not using select(), but it could be a manifestation of the same
issue.
HTH
A