using python interpreters per thread in C++ program
ganesh
ganeshborse at gmail.com
Mon Sep 7 22:22:17 EDT 2009
More information about the Python-list mailing list
Mon Sep 7 22:22:17 EDT 2009
- Previous message (by thread): using python interpreters per thread in C++ program
- Next message (by thread): using python interpreters per thread in C++ program
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
My application is a TCP server having multiple client connectons. C++ PTHREADS are for each connected socket and the message received on the socket is evaluated by python functions. If I use only one process level python interpreter, then every thread has to lock the GIL & so blocking the other threads from executing the python code even if it is not the same python function that locking thread is calling. -- That's why I tried using python interpreters per thread. But that also required GIL locking & so cannot be used. -- I cannot use python threads inside the Pyton intrepreter because then I will have to have some mechanism for communiaction between C++ Pthreads with these python threads. I think there is no way that we can achieve this because of the GIL being a process level state. Least I can do is have one python interpreter initialized in main thread and lock the GIL in every thread for python calls.
- Previous message (by thread): using python interpreters per thread in C++ program
- Next message (by thread): using python interpreters per thread in C++ program
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list