Python and threaded environments

  • Thread starter Eric S. Johansson
  • Start date
E

Eric S. Johansson

at this point, I am looking more for a "is this practical/what will I get" response than an actual how to do it.

I'm looking at putting python into emailrelay. Internally, it's POSIX threaded c++.

If I use the very high-level technique described in the documentation, will it:
create a single instance of Python that blocks all thread activity,
one instance of Python per thread, or
1 thread of Python per thread?

Is it possible to get one instance of Python runtime environment per thread?

Is it possible to get one Python thread to 1 C++ thread relationship?

can one toss and restart a python environment periodically in order to "fix" problems with resource leeks?


ideally, I would like to see something like one instance of Python runtime per thread so that users won't need to worry about writing thread safe code. but most of all, I would like an incremental approach that I can gradually move into full python integration.

---eric
 
A

Aahz

If I use the very high-level technique described in the documentation,
will it:

create a single instance of Python that blocks all thread activity,
one instance of Python per thread, or
1 thread of Python per thread?

None of the above. Your first answer is the default, but it's possible
to create an instance of Python that doesn't block thread activity.
Is it possible to get one instance of Python runtime environment per
thread?

No.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top