Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #21505

Re: Launching A Truly Disjoint Process

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <d@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python,': 0.01; 'concurrently': 0.07; 'front-end': 0.07; 'python': 0.08; '(possibly': 0.09; 'bash': 0.09; 'googling': 0.09; 'i.e.,': 0.09; 'skip:` 30': 0.09; 'essentially': 0.10; 'intermediate': 0.15; '(whose': 0.16; 'assertion': 0.16; 'bash,': 0.16; 'crashes': 0.16; 'debugged': 0.16; 'debugger': 0.16; 'failed.': 0.16; 'given).': 0.16; 'hypothetical': 0.16; 'otoh,': 0.16; 'received:192.168.1.104': 0.16; 'cc:addr:python-list': 0.16; 'this:': 0.16; 'wrote:': 0.18; 'arguments': 0.18; 'thanks,': 0.19; 'seems': 0.20; 'cc:no real name:2**0': 0.21; 'header:In-Reply- To:1': 0.22; 'runs': 0.23; 'fine,': 0.23; 'skip:m 30': 0.24; 'modify': 0.25; 'process,': 0.25; 'cc:2**0': 0.26; 'module': 0.26; 'code': 0.26; 'function': 0.27; 'code,': 0.28; 'work,': 0.28; 'separate': 0.28; "i'm": 0.28; 'script': 0.28; 'second': 0.28; 'script.': 0.29; 'sorry,': 0.29; 'unknown': 0.29; 'problem': 0.29; 'skip:b 20': 0.29; 'cc:addr:python.org': 0.29; 'pm,': 0.29; '(and': 0.30; 'environment.': 0.30; 'compiling': 0.30; 'invoke': 0.30; 'parent': 0.30; 'processes.': 0.30; 'queue': 0.30; 'least': 0.30; 'error': 0.30; 'app': 0.31; 'version': 0.32; 'thread': 0.32; 'there': 0.33; "won't": 0.33; 'this.': 0.33; 'header:User- Agent:1': 0.33; 'record': 0.34; 'running': 0.34; 'something': 0.35; 'two': 0.36; 'sequence': 0.37; 'run': 0.37; 'hello,': 0.37; 'but': 0.37; 'using': 0.37; 'either': 0.37; "i'll": 0.38; 'enough': 0.38; 'uses': 0.38; 'received:192': 0.38; 'some': 0.38; 'should': 0.38; 'received:192.168.1': 0.39; 'clearly': 0.39; 'that.': 0.39; 'processing': 0.39; 'except': 0.39; 'cannot': 0.39; 'called': 0.40; 'client': 0.40; 'being': 0.40; 'put': 0.40; 'change': 0.40; 'more': 0.61; 'your': 0.61; 'therefore,': 0.68; 'header:Reply-To:1': 0.70; 'reply-to:no real name:2**0': 0.72; 'consisted': 0.84; 'yielded': 0.84; 'originated': 0.91
Date Sun, 11 Mar 2012 17:34:41 -0400
From Dave Angel <d@davea.name>
User-Agent Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.27) Gecko/20120216 Thunderbird/3.1.19
MIME-Version 1.0
To Ami Tavory <atavory@gmail.com>
Subject Re: Launching A Truly Disjoint Process
References <CABxKp+kTMqFi8k1hMMf1Z+f9SEn1g8s5gcpxJo3s0A5CBJgjWA@mail.gmail.com>
In-Reply-To <CABxKp+kTMqFi8k1hMMf1Z+f9SEn1g8s5gcpxJo3s0A5CBJgjWA@mail.gmail.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Provags-ID V02:K0:StM3BYL1yqVJmT50pgU9hBM2duuNil8241tbJAqVvTm ZpOWJQGRlgIBQd13FE0qRC70FUjSV6990qPMpFoP8L967tHUOj Y3unuXNMZOc2SbqsC42fXCRLzuhVbvYaFckRPWNjqBz/95il2B MoVU597UeAVVARLRkfqZx3Q+fLWyYmMFJ34u0n7gUuop7SvJ2r 2kQp8p1/iXoD0YZ4iuSwvGL3wiuWvxcnhPDzZJT58A9/iH7VFy BACr5j+OEq3DSZOVM6su9US3Y4uVpgVclDgMbO17BX4uYuTvP4 YMciJXYRi5RrstIvBdVUsfBxLZh51THcLDR06tSqVl3tb3TBQ= =
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
Reply-To d@davea.name
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.573.1331501720.3037.python-list@python.org> (permalink)
Lines 56
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1331501720 news.xs4all.nl 6939 [2001:888:2000:d::a6]:32778
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:21505

Show key headers only | View raw


On 03/11/2012 05:01 PM, Ami Tavory wrote:
>    Hello,
>
>    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).
>
>    The code is a small python debugger front-end for GEdit. The plugin code,
> run from GEdit's process, uses
> <code>multiprocessing.Process(target = run_dbg)</code>
> to launch the debugger in a function in separate process. The debugger uses
> the bdb module like this:
> <code>bdb.run('execfile("%s")' % script)</code>.
>    This seems to work fine, except if the script being debugged is itself a
> pygtk script. Specifically, if it contains the code
> <code>Gtk.main()</code>
> then GEdit crashes with
> <error>
> [xcb] Unknown sequence number while processing queue
> [xcb] Most likely this is a multi-threaded client and XInitThreads has not
> been called
> [xcb] Aborting, sorry about that.
> gedit: ../../src/xcb_io.c:273: poll_for_event: Assertion
> `!xcb_xlib_threads_sequence_lost' failed.
> </error>
>    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).
>    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?
>
>    Thanks,
>
>    Ami
>

Why not try using bash as an intermediate executable?  Have your first 
python process invoke bash, giving it the arguments to in turn launch 
the second python process.

If that won't work, then at least tell us some more of your 
environment.  What version of Python, what version of OS?

-- 

DaveA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Launching A Truly Disjoint Process Dave Angel <d@davea.name> - 2012-03-11 17:34 -0400

csiph-web