<div dir="ltr">  Hello,<br><br>  I'm encountering a problem using the multiprocessing module to create a process that is truly disjoint from the parent process: i.e., one that contains no "memory" of the parent process, nor any record in the parent process that it is its child. This originated in a pygtk problem, but I'll try to put down as little pygtk as possible - just enough to explain the problem (also, sorry, but I couldn't get an answer at the gtk forum).<br>

<br>  The code is a small python debugger front-end for GEdit. The plugin code, run from GEdit's process, uses<br><code>multiprocessing.Process(target = run_dbg)</code><br>to launch the debugger in a function in separate process. The debugger uses the bdb module like this:<br>

<code>bdb.run('execfile("%s")' % script)</code>.<br>  This seems to work fine, except if the script being debugged is itself a pygtk script. Specifically, if it contains the code<br><code>Gtk.main()</code><br>

then GEdit crashes with<br><error><br><div>[xcb] Unknown sequence number while processing queue<br>[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called<br>[xcb] Aborting, sorry about that.<br>

gedit: ../../src/xcb_io.c:273: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.<br></error><br></div>  Googling this error yielded many results, but they all consisted of advice to change either the code launching the process (possibly compiling it differently), or change the launched process running gtk. It seems like gtk requires that a single thread run this. Unfortunately, in this case, the launching process is GEdit (whose code I cannot modify from a plugin), and the launched process essentially runs a hypothetical script that is being debugged (and whose code, therefore, is a given). <br>
  OTOH, clearly it is possible to run more than a single gtk app concurrently from completely separate processes. Is there a way, therefore, to launch the second process, or have the launched process do something when it starts, so that the two processes should essentially be disjoint?<br>
<br>  Thanks,<br><br>  Ami<br>
</div>