[ANNOUNCE] Garbage collection for Python

Tim Peters tim_one at email.msn.com
Tue Apr 11 12:00:40 EDT 2000


[Hrvoje Niksic]
> This is still different from being able to embed multiple Python
> instances in threads.

[Will Ware]
> Are we talking about multiple Python instances running in a single
> thread? That sounds like a very big challenge. ...

Perhaps, but it's already been done <wink>.  See Py_NewInterpreter() in the
"Initialization, Finalization, and Threads" section of the Python/C API
manual.  There isn't a Python-level interface to this yet; if you want
multiple interpreters in a single thread, for now you need to call
Py_NewInterpreter() from a C extension.

> The Python VM would need to be rewritten to be reentrant so that
> multiple VMs could simultaneously coexist, with distinct copies of
> the entire computing environment (globals, locals, which modules had
> been imported, etc). Then you'd need to arrange context switches; ...

Right, that's all there already, but (again) only from C.  See the manual
for a description of subtleties.

have-yet-to-see-anyone-use-it!-ly y'rs  - tim






More information about the Python-list mailing list