From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kcn5b-0007fw-BP for qemu-devel@nongnu.org; Mon, 08 Sep 2008 16:11:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kcn5Z-0007fT-Py for qemu-devel@nongnu.org; Mon, 08 Sep 2008 16:11:59 -0400 Received: from [199.232.76.173] (port=35097 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kcn5Z-0007fQ-NI for qemu-devel@nongnu.org; Mon, 08 Sep 2008 16:11:57 -0400 Received: from mail2.shareable.org ([80.68.89.115]:58796) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kcn5Z-0001Or-I1 for qemu-devel@nongnu.org; Mon, 08 Sep 2008 16:11:57 -0400 Date: Mon, 8 Sep 2008 21:11:54 +0100 From: Jamie Lokier Subject: Re: [Qemu-devel] [PATCH] opengl rendering in the sdl window Message-ID: <20080908201154.GA14800@shareable.org> References: <48C168CE.5040700@eu.citrix.com> <48C348D3.6070702@codemonkey.ws> <20080908134140.GF4947@shareable.org> <20080908134833.GQ2315@redhat.com> <48C53D24.8030803@redhat.com> <20080908150759.GB8465@shareable.org> <20080908154700.GT2315@redhat.com> <48C54D62.5060509@codemonkey.ws> <20080908194834.GC13612@shareable.org> <48C583A9.8090006@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48C583A9.8090006@codemonkey.ws> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org 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