Re: [PATCHv2 2/7] xread: poll on non blocking fds

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 17, 2015 at 12:51:08PM -0800, Stefan Beller wrote:

> > poll() returns -1; errno = EAGAIN /* poll failed. If the fd was OK, the failure may be temporaly,
> >                                     as much as poll() can see.
> >                                     But most probably we run out ouf memory */
> 
> Before this patch we would not have asked poll, but had just a continue here,
> so I think we need to have it here again no matter of the return code
> of the poll.
> 
> If poll determines it is low on memory, this should not make this function fail,
> we can still do as good as we did before by just asking read
> repeatedly again, though?
> 
> So I'd be convinced now we'd want to have:
> 
>     poll(&pfd, 1, -1); /* this is only buying time
>                         for the fd to deliver data, in case it fails
>                         we don't care but just fall back to old
>                         behavior before this patch with busy spinning*/
>     continue;

Right. I think that is the only sensible thing, and your comment
explains perfectly what is going on.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]