Just an update for that person having troubles calling os.fork() in a
pygtk program, I have a bit more information now.  When the program ends
with the sys.exit() function (or reaching EOF), some handlers installed
with the atexit function will be called.

X doesn't like it when the child uses the parent's X connection, or tries
to free the parent's resources.  So we need a way to get arround the exit
handlers.

One way is to os.exec() an other program (like /bin/true), but this incurs
some wasted processor time.  A quicker way is to use the os._exit()
function (which is the equivalent of the C _exit function).  It basically
exits without cleanup, which is what we want for a child process.

If you wanted both processes to use GTK, you should import gtk after the
fork().

James Henstridge.

--
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/


To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

Reply via email to