473,396 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Urgent: Embedding Python problems - advice sought

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
[b] many sub-interpreters with one thread state each
[c] many sub-interpreters with many threas states each
Thanks for helping
Alan

Aug 17 '05 #1
4 1653
Does anyone have advice on other groups, sites etc that has knowledge
of this subject ?

Thanks

Aug 17 '05 #2
ad*******@eircom.net writes:
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).
[b] 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

--
ARTHUR: Yes. It was on display in the bottom of a locked filing
cabinet stuck in a disused lavatory with a sign on the door
saying "Beware of the Leopard".
-- The Hitch-Hikers Guide to the Galaxy, Episode 1
Aug 17 '05 #3
ad*******@eircom.net writes:
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

--
<Nafai> w00t w00t w00t w00t!
<Nafai> I don't understand all of the code, but it works!
<Nafai> I guess I should check it in.
-- from Twisted.Quotes
Aug 17 '05 #4
Thanks Michael.

I will look into the areas you have suggested...

Alan

Aug 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Roose | last post by:
With some googling I have found these resources: http://docs.python.org/ext/win-dlls.html http://www.python.org/doc/faq/windows.html I have a large Win32/MFC/C/C++ application that has an...
0
by: adsheehan | last post by:
Hi, I am embedding Python into a multi-threaded application running on Solaris. Python will enable end users to customize and re-program many aspects of the application. I expect that the C++...
0
by: adsheehan | last post by:
Hi, I am embedding Python into a multi-threaded C++ application runnig on Solaris and need urgent clarification on the embedding architecture and its correct usage (as I am experience weird...
0
by: adsheehan | last post by:
Hi, I am embedding Python into a multi-threaded C++ application runnig on Solaris and need urgent clarification on the embedding architecture and its correct usage (as I am experience weird...
0
by: Kenneth McDonald | last post by:
We're looking at embedding Python into our product to provide users with the ability to write scripts for the programming. My knowledge of Python is excellent, I'm familiar with the concepts of...
3
by: John Pye | last post by:
Hi all I have been working on some new code that embeds python in an C application. The embedding is working fine under Linux but crashing under Windows (XP) when I reach the following step. ...
9
by: Duncan Smith | last post by:
Hello, I find myself in the, for me, unusual (and at the moment unique) position of having to write a web application. I have quite a lot of existing Python code that will form part of the...
0
by: Severian | last post by:
I am working on embedding Python 2.5 in my C++ application, and I have a few questions: 1) My application is multi-threaded; what problems should I be aware of if I create a separate interpreter...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.