Re: A thread import problem

Discussion in 'Python' started by Bruce Sherwood, Jul 23, 2012.

  1. 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
    <> wrote:
    > On Sun, Jul 22, 2012 at 7:14 PM, Bruce Sherwood
    > <> 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
    Bruce Sherwood, Jul 23, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stefan Seefeld
    Replies:
    3
    Views:
    946
  2. per9000
    Replies:
    7
    Views:
    392
    Magnus Lycka
    Feb 27, 2006
  3. Bruce Sherwood

    A thread import problem

    Bruce Sherwood, Jul 19, 2012, in forum: Python
    Replies:
    0
    Views:
    145
    Bruce Sherwood
    Jul 19, 2012
  4. Dennis Lee Bieber

    Re: A thread import problem

    Dennis Lee Bieber, Jul 19, 2012, in forum: Python
    Replies:
    0
    Views:
    160
    Dennis Lee Bieber
    Jul 19, 2012
  5. Dieter Maurer

    Re: A thread import problem

    Dieter Maurer, Jul 19, 2012, in forum: Python
    Replies:
    0
    Views:
    135
    Dieter Maurer
    Jul 19, 2012
Loading...

Share This Page