Urgent: Embedding Python problems - advice sought

A

adsheehan

Hi,


I am embedding Python into a multi-threaded C++ application running on
Solaris and need urgent clarification on the embedding architecture and
its correct usage (as I am experience weird behaviors).


Can anyone clarify:


- if Python correctly supports multiple sub-interpreters
(Py_NewInterpreter) ?


- if Python correctly supports multiple thread states per
sub-interpreter (PyThreadState_New) ?


and the "real" question:


- what is the rationale for choosing one of:


[a] one sub-interpreter with many thread states
many sub-interpreters with one thread state each
[c] many sub-interpreters with many threas states each


Thanks for helping
Alan
 
A

adsheehan

Does anyone have advice on other groups, sites etc that has knowledge
of this subject ?

Thanks
 
M

Michael Hudson

Hi,


I am embedding Python into a multi-threaded C++ application running on
Solaris and need urgent clarification on the embedding architecture and
its correct usage (as I am experience weird behaviors).

What version of Python are you using?
Can anyone clarify:


- if Python correctly supports multiple sub-interpreters
(Py_NewInterpreter) ?

It's supposed to but it's not often used or tested and can get a bit
flaky.
- if Python correctly supports multiple thread states per
sub-interpreter (PyThreadState_New) ?

There are bugs in 2.3.5 and 2.4.1 in this area (they are fixed in CVS
-- I hope -- and will be in 2.4.2).
and the "real" question:


- what is the rationale for choosing one of:


[a] one sub-interpreter with many thread states

This is the best tested and understood (it's what the core Python
interpreter does, after all).
many sub-interpreters with one thread state each
[c] many sub-interpreters with many threas states each


These are probably somewhat broken in recent Python's, I'm afraid.
Can you try CVS?

Cheers,
mwh
 
M

Michael Hudson

Does anyone have advice on other groups, sites etc that has knowledge
of this subject ?

I've just replied to your original post, having not seen it the first
time around.

Cheers,
mwh
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top