On Apr 11, 6:24 pm, [EMAIL PROTECTED] wrote: > Do I wind up with two completely independent interpreters, one per thread? > I'm thinking this doesn't work (there are bits which aren't thread-safe and > are only protected by the GIL), but wanted to double-check to be sure.
You can create a new interpreter with a call to Py_NewInterpreter. However, the GIL is a global object for the process. If you have more than two interpreters in the process, they share the same GIL. In tcl, each thread has its own interpreter instance and no GIL is shared. This circumvents most of the problems with a global GIL. In theory, a GIL private to each interpreter would make Python more scalable. The current GIL behaves like the BKL in earlier Linux kernels. However, some third-party software, notably Apache's mod_python, is claimed to depend on this behaviour. -- http://mail.python.org/mailman/listinfo/python-list