More than one interpreter per process?
sturlamolden
sturlamolden at yahoo.no
Tue Dec 18 10:37:28 EST 2007
On 18 Des, 10:24, Roger Binns <rog... at rogerbinns.com> wrote:
> You can. Have a look at mod_python and mod_wsgi which does exactly
> this. But extension modules that use the simplified GIL api don't work
> with them (well, if at all).
mod_python implements use Py_NewInterpreter() to create sub-
interpreters. They all share the same GIL. The GIL is declared static
in ceval.c, and shared for the whole process. But ok, if
PyEval_AquireLock() would take a pointer to a 'sub-GIL', sub-
interpreters could run concurrent on SMPs. But it would require a
separate thread scheduler in each subprocess.
More information about the Python-list
mailing list