Re: MIT-SHM example



On Mon, 2005-09-19 at 16:44 +0000, Rose Cumming wrote:
> I'm not confused.
> My application (client) and the X server are running on the same machine.
> 
> I want to have very high frame rates to playback my raw data images.
> I have tried drawing primitives like draw_rgb_image and draw_gray_image.
> 
> What you said was consistent with previous email archieves I read. Using 
> MIT-SHM will avoid network flow because the image (Xmage) use shared memory 
> when the client and server are on the same machine.
> I have this link
> http://ftp.xfree86.org/pub/XFree86/4.5.0/doc/mit-shm.txt
> that talks about shared memory XImage.
> 
> but if anyone has working example of how to set up a simple application, it 
> would be greatly appreciated.

i am afraid that you *are* confused. controlling the use of MIT-SHM is
not intended to be an option for an application. the version of Xlib
that you are linked against will check whether the server supports it.
if the server does support it, then any realworld Xlib implementation
will use it.

using XImage has a number of costs *regardless* of whether MIT-SHM is
present or not. it is *not* the fastest way to draw an image all the
time - that depends a great deal on what the image is, on the type of
the server, the host system you are running on, and more.

if you want to draw images quickly, please forget about MIT-SHM. it is
not an important part of the code you will write. there are reasons to
prefer using a client side image on occasion; there are reasons to
prefer a server side image on other occasions. these reasons exist and
are true with *and* without MIT-SHM.

>I want to use low level Xlib drawing API with a Gtk::DrawingArea.
>My application is targeted on a single host machine. So I want to use
>the fastest way to draw images possible.

Why on earth do you imagine that using gdk routines, which normally map
1:1 onto Xlib routines, will be measurably slower than Xlib routines? if
your frame rate is slow, you should look to your algorithms for drawing
and for the overall structure of your code.

People use GDK/GTK to get frame rates that are essentially identical to
what they would get if they had raw access to the h/w. *Without* using
Xlib, and without even stopping to think about whether or not MIT-SHM is
present or not.

--p





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