Sharing between multiple interpreters and restricted mode

Discussion in 'Python' started by gabriel.becedillas@gmail.com, Jan 4, 2006.

  1. Guest

    Hi,
    At the company I work for we've embedded Python 2.4.1 in a C++
    application. We execute multiple scripts concurrenlty, each one in its
    own interpreter (created using Py_NewInterpreter()).
    We are sharing a certain instance between interpreters because its to
    expensive to instantiate that class every time an interpreter is
    created. The class is instantiated in the main interpreter (that is
    always alive) and every time a new interpreter is created, that
    instance is added to the interpreter's __builtins__ dict.
    The problem I'm having is that some methods of that class (when
    executed in an interpreter different from the one it was created in)
    complain about being in restricted execution mode.
    Assuming that there are no issues with this instance lifetime (coz it
    will always be referenced by the main interpreter), is there a safe way
    to do some sharing between interpreters ?.
    Thanks.
     
    , Jan 4, 2006
    #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. Casey Hawthorne
    Replies:
    4
    Views:
    375
    Casey Hawthorne
    Oct 20, 2005
  2. Nadav
    Replies:
    0
    Views:
    289
    Nadav
    Jun 16, 2004
  3. Nadav
    Replies:
    0
    Views:
    289
    Nadav
    Jun 18, 2004
  4. John J Lee
    Replies:
    3
    Views:
    524
    bruno at modulix
    Dec 1, 2005
  5. Edward Loper
    Replies:
    0
    Views:
    510
    Edward Loper
    Aug 7, 2007
Loading...

Share This Page