using python interpreters per thread in C++ program

ganesh ganeshborse at
Mon Sep 7 10:47:41 CEST 2009

On Sep 7, 3:41 pm, Graham Dumpleton <graham.dumple... at>
> On Sep 7, 3:42 pm, sturlamolden <sturlamol... at> wrote:
> interpreters. The simplified GIL state API you mentioned only works
> for threads operating in the main (first) interpreter created within
> the process.

I modified my program to have Py_Initialize and compilation of one
Python function done in main() thread. Then I am calling only that
function in callPyFunction() thread. But, this thread does not come
out of PyGILState_Ensure() function.

> The OP can do what they want, but they need to user lower level
> routines for creating their own thread state objects and acquiring the
> GIL against them.
> Graham

What are the "lower level routines" for creating own thread state
objects & acquiring GILs.
Also, where can I find more information about those routines?

Please guide. Thanks.

More information about the Python-list mailing list