[Top][All Lists]
[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 20:48:34 +0100 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
Anthony Liguori wrote:
> shmget()
> shmat()
>
> ...
>
> notify server of key
> wait for server to confirm shmat()
>
> ...
>
> shmctl(IPC_RMID)
>
> ..
>
> shmdt()
>
> Which leaves a huge window open where bad things can happen. The client
> can exit, the client can crash. This is particularly troublesome in a
> library because it's really not nice to try and register an atexit()
> handler or something like that from a library.
Another way to do it, which ought to be quite reliable, is to fork()
(and maybe exec) a child helper process which calls shmget() then
prints out the ID, for the parent to read, then waits on its input.
There is also a pipe from parent to child. If the parent closes the
pipe to child or dies, the child kills the shm ID immediately. This
catches all kinds of parent crashing and deliberate kills, and you can
still close the pipe as soon as the parent confirms everyone is
attached to the segment.
What do Gtk and/or Qt and/or Gecko do? They're likely to have thought
about it.
-- Jamie
- Re: [Qemu-devel] [PATCH] opengl rendering in the sdl window, (continued)
- Re: [Qemu-devel] [PATCH] opengl rendering in the sdl window, Jamie Lokier, 2008/09/08
- Re: [Qemu-devel] [PATCH] opengl rendering in the sdl window, Daniel P. Berrange, 2008/09/08
- Re: [Qemu-devel] [PATCH] opengl rendering in the sdl window, Anthony Liguori, 2008/09/08
- Re: [Qemu-devel] [PATCH] opengl rendering in the sdl window, Mike Kronenberg, 2008/09/08
- Re: [Qemu-devel] [PATCH] opengl rendering in the sdl window, Gerd Hoffmann, 2008/09/08
- Re: [Qemu-devel] [PATCH] opengl rendering in the sdl window, Mike Kronenberg, 2008/09/08
- Re: [Qemu-devel] [PATCH] opengl rendering in the sdl window, Jamie Lokier, 2008/09/08
- Re: [Qemu-devel] [PATCH] opengl rendering in the sdl window,
Jamie Lokier <=
- Re: [Qemu-devel] [PATCH] opengl rendering in the sdl window, Anthony Liguori, 2008/09/08
- Re: [Qemu-devel] [PATCH] opengl rendering in the sdl window, Jamie Lokier, 2008/09/08
- Re: [Qemu-devel] [PATCH] opengl rendering in the sdl window, Daniel P. Berrange, 2008/09/08
- Re: [Qemu-devel] [PATCH] opengl rendering in the sdl window, Jamie Lokier, 2008/09/08
- Re: [Qemu-devel] [PATCH] opengl rendering in the sdl window, Anthony Liguori, 2008/09/08
- Re: [Qemu-devel] [PATCH] opengl rendering in the sdl window, Jamie Lokier, 2008/09/09
- Re: [Qemu-devel] [PATCH] opengl rendering in the sdl window, Anthony Liguori, 2008/09/08
- Re: [Qemu-devel] [PATCH] opengl rendering in the sdl window, Avi Kivity, 2008/09/07
- Re: [Qemu-devel] [PATCH] opengl rendering in the sdl window, Daniel P. Berrange, 2008/09/07
- Re: [Qemu-devel] [PATCH] opengl rendering in the sdl window, Avi Kivity, 2008/09/07