[Python-Dev] Extension modules, Threading, and the GIL

Mark Hammond mhammond@skippinet.com.au
Thu, 9 Jan 2003 00:49:36 +1100


> Mark Hammond wrote:
> > 1) Allow "arbitrary" threads (that is, threads never before
> seen by Python)
> > to acquire the resources necessary to call the Python C API.
>
> This is possible today, all you need is a pointer to an interpreter
> state. If you have that, you can use PyThreadState_New,

But what if in some cases, this callback is as a result of Python code on
the same thread - ie, there already exists a Python thread-state higher up
the stack?

Mark.