qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] opengl rendering in the sdl window


From: Jamie Lokier
Subject: Re: [Qemu-devel] [PATCH] opengl rendering in the sdl window
Date: Mon, 8 Sep 2008 21:11:54 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Anthony Liguori wrote:
> But you still leak if both processes are killed at once (think killall 
> qemu-system-x86_64).  An exec would be a little safer but it's pretty 
> hideous.

I agree it's not pretty.

> 
> >What do Gtk and/or Qt and/or Gecko do?  They're likely to have thought
> >about it.
> >  
> 
> It's not a problem for Gtk because the window of possibly leaking is so 
> short.  It creates the shmid, send it to the x server, shmat, then 
> shmctl.  The key point is that it interacts with the X server 
> synchronously so not much bad can happen while it's talking to the X server.

Gtk is a library too.  Sure, it's usually used synchronously, but
other user threads can terminate the program while Gtk is doing its
stuff.  Not _that_ different from providing an async VNC client
library with an API function "vnc_cleanup - call this if your program
terminates and you might not have closed all VNC connections".  User
program can call atexit() themselves, or g_atexit() if it's a Gtk
program.  That's reasonably conventional.

> It's probably not a huge problem in practice, but I've never liked 
> this.  Sys V shared memory is really just crappy.

Yes, and POSIX shm seems to perpetuate the silliness, though a bit
more flexible in what you can put into an ID.

-- Jamie




reply via email to

[Prev in Thread] Current Thread [Next in Thread]