Pushing image transport logic down the stack

Owen Taylor otaylor at redhat.com
Tue Sep 5 13:08:00 PDT 2006


On Tue, 2006-09-05 at 14:48 -0400, Owen Taylor wrote:

> My test program can be found at:
> 
>  http://fishsoup.net/software/buffer-passing/buffer-passing-0.1.tar.gz
> 
> if anyone wants to take a look or make it more accurately simulate 
> different types of operations.

I just realized that the way I was managing shared memory buffers in
my test code was pretty stupid - the client and server can agree on
a file descriptor in advance, so the only thing needed to pass 
information in a temporarily allocated buffer is:

 process 1: ftrunctate(fd, new_size)/mmap()/write-to-it/munmap()
 process 2: mmap()/read-from-it/munmap()/ftruncate(fd, 0);

I stuck a version that does things that way at:

http://fishsoup.net/software/buffer-passing/buffer-passing-0.2.tar.gz

And it does reduce the cost of the buffer management several times - 
down to maybe 20,000 cycles.

But that doesn't change the conclusion at all ... if you can't avoid
touching the data on the way out, paying a non-zero cost for shared
memory is a bad idea.
						- Owen

[ Apologies for the noise ]





More information about the xorg mailing list