473,473 Members | 2,098 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Detached interpreter threads

Hi-

I am writting an application in C++ that I am attempting to embed an
interpreter in. I know about how I need to protect the interpreter
internals from mean nasty threads in my program, but I am runnning
across a problem I don't quite understand.

Here is my flow of control:

C++ Main starts up
Py_Initialize() is run
PyEval_InitThreads() is run ( or whatever it is called )
PyRun_SimpleFile() is called with Loader.py
Loader.py begins to execute:
Loader.py prints it is running
Loader.py does a few imports
Loader.py does a start_new_thread()
Loader.py says it is done running
Control returns to C++ program

The problem is that the new thread started by Loader doesn't every
have its entry point called. I made the very first line a print,
but that didn't ever get executed. If I run Loader.py on its own, it
works just fine and dandy. I have the same construct in Jython that
works perfectly, so I am kind of puzzled as to why interpreter threads
don't run.

Any thoughts?

--
ch***@acheris.net | Fight Censorship, Boycott Wal-Mart
Now is the winter of your discontent! - Stewie
Jul 18 '05 #1
0 1034

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

Similar topics

1
by: Kim Gijung | last post by:
Hi all, I'm wondering how the apache server and php interepreter handles request. If one request comes to apache server what is next procedure? if apache server passes the request to php...
0
by: Atul Kshirsagar | last post by:
I am embedding python in my C++ application. I am using Python *2.3.2* with a C++ extention DLL in multi-threaded environment. I am using SWIG-1.3.19 to generate C++ to Python interface. Now to...
2
by: Jarppe | last post by:
Hello, What should I do to be able to call Pyhton interpreter from a posix thread that is created in C? I have a C-library that creates a thread and then makes callbacks to user supplied...
3
by: adsheehan | last post by:
Hi, Does anyone know the reasoning or pros/cons for either (in a multi-threaded C++ app): - creating many sub-interpreters (Py_NewInterpreter) with a thread state each Or
61
by: km | last post by:
Hi all, is true parallelism possible in python ? or atleast in the coming versions ? is global interpreter lock a bane in this context ? regards, KM
5
by: jurson | last post by:
Hello, I remove row from DataTable. It works ok, the row is removed from collection. It should be marked as 'detached'. Am I right? Then I try to retrieve 'detached' rows using the code shown...
1
by: Ryan Liu | last post by:
Hi, Is that safe to say a Detached DataRow neve in a DataTable's Rows collectoin? But in my log file, I do see a Detached row: foreach(DataRow dr in this.currentQuotaUserDt.Rows) {
10
by: Janto Dreijer | last post by:
I have been having problems with the Python 2.4 and 2.5 interpreters on both Linux and Windows crashing on me. Unfortunately it's rather complex code and difficult to pin down the source. So...
8
by: jehugaleahsa | last post by:
Hello: We wrote an entire application where we add our DataRows to our DataTables immediately. However, we have to shut off our constraints to do this. We would like to use detached DataRows to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
1
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.