Re: UDP recvmsg blocks after select(), 2.6 bug?

Chris Friesen
2004-10-07T17:23:40Z

Mark Mielke wrote:

> Isn't it more expensive to allow the
> application to be woken up, and poll using read(), than to just do a
> quick check in the kernel and not tell the application there is data,
> when there really isn't?

The issue is caching.

We have to do a pass over the data to copy it to userspace. If we do the
checksum verification then, it's basically free since its already in the cache.

If we do it at select() time, we end up having to do two passes over every
packet, one to verify the checksum, and one to pass it to userspace.

I agree with you though, it'd be nice to have select() change behaviour based on
whether the socket is blocking or not.

Chris