sendfile() in FileChannelImpl.c
glewis at eyesbeyond.com
Sun Oct 18 20:43:46 PDT 2009
On Fri, Oct 16, 2009 at 04:55:08PM -0700, Michael Allman wrote:
> Can someone explain why we aren't using sendfile() in the transferTo0 call
> for the case of a file transfer to a network socket in FileChannelImpl.c?
> Also, my understanding is that if this call cannot do a sendfile(), it
> should return IOS_UNSUPPORTED_CASE. This will tell the caller to do a
> loop-based transfer (see sun.nio.ch.FileChannelImpl.transferTo(), line
I think the reason is basically historical. I don't recall there being
a fallback when we originally ported the NIO code, so sendfile() didn't
make sense since it only transferred to network sockets.
Before switching I'd want to see what sort of affect that had performance
wise on the case of transferring to a file descriptor.
Greg Lewis Email : glewis at eyesbeyond.com
Eyes Beyond Web : http://www.eyesbeyond.com
Information Technology FreeBSD : glewis at FreeBSD.org
More information about the bsd-port-dev