bob@ucla-locus@sri-unix.UUCP (08/02/83)
From: Bob English <bob@ucla-locus> Calling the kernel directly for each character is (admittedly) more expensive than using stdio. On the other hand, four copies per character seems excessive, especially on virtual memory machines. Why not, for example, have a block read/write call that swaps pages in and out of the kernel rather than copying (I know "security risk!"), or even a kernel smart enough to do the copy directly from user space to user space when the pipe has a read pending. If you really wanted to get fancy (and dangerous), you could have the pipe call set up an area of shared memory and implement a stream protocol that would eliminate copies entirely. I'm not suggesting that any of these be adopted, merely that, compared to some other potential strategies, pipes have high overhead. In light of this, I think it's unreasonable to write off four copies as the best we're going to get. The pipe concept is a good one, but the concept should not be confused with the implemetation. --bob--