Re: Thread implementations...

yodaiken@chelm.cs.nmt.edu
Fri, 26 Jun 1998 14:58:42 -0600


In that case, do you really lose much from normal read/write -- esp
if you have a "raw" read mode directly into user space?

On Fri, Jun 26, 1998 at 02:37:28PM -0700, Larry McVoy wrote:
> 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 */
> : }

-- 

--------------------------------- Victor Yodaiken Department of Computer Science New Mexico Institute of Mining and Technology Socorro NM 87801 Homepage http://www.cs.nmt.edu/~yodaiken PowerPC Linux page http://linuxppc.cs.nmt.edu Real-Time Page http://rtlinux.org

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