
On Fri, May 8, 2020 at 12:30 AM Sebastian Krause <sebastian@realpath.org> wrote:
Guido van Rossum <guido@python.org> wrote:
Is there some kind of optimized communication possible yet between subinterpreters? (Otherwise I still worry that it's no better than subprocesses -- and it could be worse because when one subinterpreter experiences a hard crash or runs out of memory, all others have to die with it.)
The use case that I have in mind with subinterpreters is Windows. With its lack of fork() and the way it spawns a fresh interpreter process it always feels a bit weird to use multiprocessing on Windows. Would it be faster and/or cleaner to start a new in-process subinterpreter instead?
Subinterpreters don't support fork() either -- they can't share any objects, so each one has to start from a blank slate and go through the Python startup sequence, re-import all modules from scratch, etc. Subinterpreters do get to skip the OS process spawn overhead, but most of the startup costs are the same. -n -- Nathaniel J. Smith -- https://vorpus.org