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


Groups > comp.lang.python > #25872

Re: A thread import problem

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <bruce.sherwood@gmail.com>
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.02; 'python,': 0.02; '(so': 0.07; '64-bit': 0.07; 'tkinter': 0.07; 'api': 0.09; 'python': 0.09; '22,': 0.09; 'imports': 0.09; 'received:mail- vb0-f46.google.com': 0.09; 'gui': 0.11; 'thread': 0.11; 'library': 0.15; '(but': 0.15; 'cocoa,': 0.16; 'deadlock': 0.16; 'invocations': 0.16; 'later).': 0.16; 'subject:import': 0.16; 'thread.': 0.16; 'vpython': 0.16; 'wrote:': 0.17; 'received:209.85.212.46': 0.18; 'written': 0.20; 'subject:problem': 0.22; 'programming': 0.23; 'absolute': 0.23; 'bruce': 0.23; 'header:In-Reply-To:1': 0.25; 'message- id:@mail.gmail.com': 0.27; 'received:209.85.212': 0.28; 'run': 0.28; 'cocoa': 0.29; 'parent': 0.29; 'releases,': 0.29; 'style.': 0.29; 'maybe': 0.29; 'e.g.': 0.30; 'primary': 0.30; '(2)': 0.32; 'mac': 0.32; 'running': 0.32; 'could': 0.32; 'handle': 0.33; 'problem': 0.33; 'to:addr:python-list': 0.33; 'another': 0.33; 'version': 0.34; "can't": 0.34; 'received:google.com': 0.34; 'architecture': 0.34; 'thanks': 0.34; 'process,': 0.35; 'solving': 0.35; 'pm,': 0.35; 'remote': 0.35; 'similar': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'there': 0.35; 'but': 0.36; 'apple': 0.36; "didn't": 0.36; 'useful': 0.36; 'turn': 0.36; 'supporting': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'skip:" 10': 0.40; 'header:Received:5': 0.40; 'your': 0.60; 'skip:u 10': 0.60; 'different': 0.63; 'more': 0.63; 'jul': 0.65; 'hand': 0.82; 'case?': 0.84; 'forced': 0.84; 'mac.': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ff0L7xYSp/ufdzoGO44e3ZvGqRDoV4iy1QFHvKgMCkY=; b=Lf1TSL50oHgyW8VvVyClwSWJF5Ai1mZ7DvT0/1mlLmDEMfkgVs9BeL3TejCeW1Pnht RaJiXbsHPf/hLP52tBNqnZ0ptZkL3mVUb6tHXjfzEfCwmbMR1kvzpqTr3wSHS+9AgQVB Xab8CGYknB/6kgOLZQX/FwP6vxoZqomhfvFWXrLXNxabO1Nai12WqyzIVvJ/hrbycyMD GHQcNEPkmNYoBDYPgwwF4Mo6NouH0/oukrOKjnylz8xpLtZpJZ7vOFMe8ttCXW9CDGLY 5o7fDyR5A1HuzSkzuXO29WF2kuEV7CpnS2IMkxXn15NvZFZIVtrNuavgcTCiVF1XS3G4 9YOw==
MIME-Version 1.0
In-Reply-To <CABicbJJg8TbNd8xiKNRLVWNerKo10xSNCcpRvq2P=UW2_GGmhg@mail.gmail.com>
References <CA+WuaSeRExxaD9yCNWhXoWqsV_ZqP8DOvdErMRdNS-H_UtzQyg@mail.gmail.com> <87a9yt7bw6.fsf@handshake.de> <CA+WuaSc0Rm5s0CXsm7q7-gfyw+jQxpAGkuajpgFyoAHnTP12sQ@mail.gmail.com> <2u8m085co3j3n97jorkl04o5hr1orqb7la@invalid.netcom.com> <CA+WuaSde=GntxGMVTScOUw4_a+jqQS+nme0VpZVgH_219Qo9jA@mail.gmail.com> <5gfm08htgbrum782hfv5fqkb4084qra7vq@invalid.netcom.com> <CA+WuaScB1jycdBNPosEePGUX=8n80Wst3tGv672TK2FVq-KAig@mail.gmail.com> <jrso08pf109ki94vjtqfcdifhcl455cq54@invalid.netcom.com> <CA+WuaSd3yPY7-uwGq9_6FR8zDd9zbRmXX4bwVqLnv3z-eEhojw@mail.gmail.com> <CABicbJJg8TbNd8xiKNRLVWNerKo10xSNCcpRvq2P=UW2_GGmhg@mail.gmail.com>
Date Mon, 23 Jul 2012 08:07:26 -0600
Subject Re: A thread import problem
From Bruce Sherwood <bruce.sherwood@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
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.2470.1343052449.4697.python-list@python.org> (permalink)
Lines 35
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1343052449 news.xs4all.nl 6901 [2001:888:2000:d::a6]:46468
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:25872

Show key headers only | View raw


Thanks much for the useful suggestion, and also thanks for your
sympathy and understanding of my plight!

Bruce Sherwood

On Sun, Jul 22, 2012 at 11:50 PM, Devin Jeanpierre
<jeanpierreda@gmail.com> wrote:
> On Sun, Jul 22, 2012 at 7:14 PM, Bruce Sherwood
> <bruce.sherwood@gmail.com> wrote:
>> (2) My hand is forced by Apple no longer supporting Carbon. Among
>> other aspects of this, Carbon can't be used with 64-bit Python, and
>> more and more Mac users of VPython want to use 64-bit Python. So there
>> has to be a version of VPython that is based on Cocoa, but Cocoa is
>> required to be the primary thread. This requirement, combined with the
>> absolute requirement that the VPython API cannot be changed, is the
>> problem I face. I have to turn the architecture inside out,
>> independent of whether the solution meets all criteria for good Python
>> programming style.
>
> I had exactly this problem with Tkinter on Mac. The API involved
> "synchronous" calls to update a GUI written in tkinter, which ran in
> another thread (so e.g. students could call the API from the
> interactive interpreter). This didn't work on new Mac OS X releases,
> because Tkinter had to be run in the main thread after some update --
> and also because of this deadlock issue with imports (but I didn't
> know that until later).
>
> I ended up solving it by running the Tkinter in the main thread of a
> different process, which could handle RPC invocations asynchronously,
> and sending remote invocations via a synchronous RPC library in the
> parent process.
>
> Maybe you can do something similar in your case?
>
> -- Devin

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


Thread

Re: A thread import problem Bruce Sherwood <bruce.sherwood@gmail.com> - 2012-07-23 08:07 -0600

csiph-web