Multi Threading embedded python
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Multi Threading embedded python

From: amit <amit@digitalpeers.com>
Date: Thu Jun 30 2005 - 18:56:20 CEST

Hello,

 I am embedding a python script in a C++ application. The script can be
called simultaneously from multiple threads.

What is the correct way to implement this situation:

1) Have unique python interpreter instantiations ( Py_Initialize() ) for
each thread.

2) Have one python interpreter, and implement a lock on it so it can't
be called simultaneously by multiple threads?

Thanks
   Amit
Received on Thu Sep 29 16:40:13 2005