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


Groups > comp.lang.python > #25872

Re: A thread import problem

References (5 earlier) <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 2012-07-23 08:07 -0600
Subject Re: A thread import problem
From Bruce Sherwood <bruce.sherwood@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2470.1343052449.4697.python-list@python.org> (permalink)

Show all headers | 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