Re: gtk+ and gtk-engines slow



On Sat, 23 Jan 1999 raster@redhat.com wrote:
> On 23 Jan, bratsche@dfw.net scribbled:
> ->  So when you're running the pixmap theme and set a button pixmap to
> ->  button.png, does each application keep track of its own button.png file?

> yup. due to the fact thats its a bitch to share large chunks of
> constantly chnaging memory between apps.

Not really; I did this when I was doing a lot of news server-related
coding.  The problem then was analagous -- I had to store NNTP messages
(average size = 2-4K or so, max size 5M or more sometimes) for short
periods of time in shared memory, so that various processes
could do their work.

The solution was to create one big buffer, and manage it cooperatively
using semaphores and mutexes.  In essense, you create your own malloc
which grabs a buffer of shared memory.  It was a cyclical buffer, so
that messages (or pixmaps in this case) expired when they were
overwritten by the newest incoming message -- or pixmap in this case.

The one downside to this approach (which I didn't have to worry about in
my experiment NNTP server) is that if refcounting breaks down, you have
to manually clean the IPC shm segment list. 

	Jeff




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]