473,503 Members | 1,638 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sharing between multiple interpreters and restricted mode

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 '06 #1
0 1077

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

Similar topics

1
2141
by: Maciej Sobczak | last post by:
Hi, I'm interested in embedding the Python interpreter in a C++ application. What I miss is the possibility to create many different interpreters, so that the stuff that is running in one...
0
1024
by: Nadav | last post by:
Hi, I have two interpreters in my programs. It is safe to give them access to the same PyObject representing a dispatched COM interface? Thanks, Nadav
2
2160
by: bmatt | last post by:
I am trying to support multiple interpreter instances within a single main application thread. The reason I would like separate interpreters is because objects in my system can be extended with...
13
3983
by: Rolf Magnus | last post by:
Hi, I would like to embed a python interpreter within a program, but since that program would be able to automatically download scripts from the internet, I'd like to run those in a restricted...
0
1020
by: Wojciech Pawlikowski | last post by:
Hey, I work on some project where main part (core) is coded in C (for speed) and the rest is in Python. Python API is used to launch python modules without using any exec() system() calls (thread...
8
1887
by: Kissi Asiedu | last post by:
I have a database in a shared folder, however users with permission can only access the database in read-only format. What have I done wrong? This is on Win Xp Pro and Access 2003. Please help. ...
0
1551
by: vishnu | last post by:
Hello All, I have embedded python 2.5 in to my C application. As we need the python scripts to run in multi threaded environment I have used Py_NewInterpreter() and Py_EndInterpreter each time I...
3
2626
by: Paul Rudin | last post by:
I'm occasionally seeing tracebacks like this: Traceback (most recent call last): File "logging/__init__.py", line 744, in emit File "logging/__init__.py", line 630, in format File...
7
12478
by: skip | last post by:
This question was posed to me today. Given a C/C++ program we can clearly embed a Python interpreter in it. Is it possible to fire up multiple interpreters in multiple threads? For example: ...
0
7280
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,...
1
6991
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
5578
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
5014
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
3167
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
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
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 ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
382
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.