[Python-3000] PEP 3121 implemented

"Martin v. Löwis" martin at v.loewis.de
Tue Jun 10 22:48:23 CEST 2008


> So, when all modules are changed to properly support multiple interpreters,
> it may be possible to implement a module combining the benefits of 
> both threading and multiprocessing - moving computation to a separate
> interpreter (with its own GIL) without the need to marshal data
> across processes?

First, it will take a long to to get there: there are all the builtin
type objects (object, int, str, ..., also None, True, False) which
remain shared for a foreseeable future (although the mechanism of the
PEP *could* be used to make them per-interpreter as well).

Second, there is some code that would still be thread-unsafe afterwards,
pymalloc in particular.

Third, once you managed to truly separate interpreters, you *will*
have to marshal objects across interpreters, as there won't be any
shared ones. It's in the same address space, but you still would
have to do marshalling, or else you might introduce sharing again.

So in short: no :-)

Regards,
Martin


More information about the Python-3000 mailing list