Messages in this thread | | | From | (Larry McVoy) | Subject | Re: Thread implementations... | Date | Fri, 26 Jun 1998 14:37:28 -0700 |
| |
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
| |