lkml.org 
[lkml]   [1998]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: Thread implementations...
    Date
    This mode only works if there is a perfect ``impedance match'' between
    the source and the sink. What if you need to do a bunch of small reads
    from the source and then one large write to the sink? This is not a
    made up example, it occurs all the time when trying to source from the
    network and sink to the disk when the disk a a logical volume that needs
    to get sent a large chunk in order to go fast.

    : What's wrong with ?
    : /dev/sendfile
    :
    : struct transmit { int fdin,fdout,count};
    : struct complete {int countsent, errorin,errorout}
    :
    : /* implement sendfile */
    : sendfile(fd1,fd2,count) {
    : int fd;
    : struct transmit t;
    : struct complete r;
    :
    : fd = open("/dev/sendfile",2,synchronous);
    : transmit.fdin = f1;
    : transmit.fdin = f2;
    : write(fd,&transmit,sizeof transmit); /* ask to transfer */
    : read(fd,&complete, sizeof complete); /* read status */
    : }

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu

    \
     
     \ /
      Last update: 2005-03-22 13:43    [W:3.155 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site