Pushing image transport logic down the stack

Owen Taylor otaylor at redhat.com
Wed Sep 6 06:33:20 PDT 2006


On Wed, 2006-09-06 at 01:09 +0200, Peter "Firefly" Lund wrote:
> On Tue, 5 Sep 2006, Owen Taylor wrote:
> 
> > process 1: ftrunctate(fd, new_size)/mmap()/write-to-it/munmap()
> > process 2: mmap()/read-from-it/munmap()/ftruncate(fd, 0);
> 
> Is it really necessary to mmap/munmap/ftruncate all the time?

The question I was trying answer was:

 "Does it ever make sense to temporarily allocate a shared memory
  buffer so that we can pass an entire image at one go"

As far as I know, the above is about as simple as you can get for
/temporarily/ allocating a shared memory buffer. Until you 
munmap and ftruncate, you have a permanent reservation of memory
that has to be swapped out to disk to be reused by another 
application. If an application can accurately predict its future image
transport needs, using a pre-allocated buffer is an obvious strategy.

                                    - Owen


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg/attachments/20060906/3b44f2fb/attachment.pgp>


More information about the xorg mailing list