[Python-Dev] Sub-interpreters: importing numpy causes hang

Nick Coghlan ncoghlan at gmail.com
Mon Jan 28 03:27:45 EST 2019


On Mon, 28 Jan 2019 at 00:32, Stephan Reiter <stephan.reiter at gmail.com> wrote:
>
> Cool. Thanks, Nick!
>
> I did experiments based on this idea (https://github.com/stephanreiter/cpython/commit/3bca91c26ac81e517b4aa22302be1741b3315622) and haven't rejected it yet. :-)

After talking to Graham about this, I unfortunately realised that the
reason the callback approach is appearing to work for you is because
your application is single-threaded, so you can readily map any
invocation of the callback to the desired interpreter. Multi-threaded
applications won't have that luxury - they need to be able to set the
callback target on a per-thread basis.

Graham actually described a plausible approach for doing that several
years back: https://bugs.python.org/issue10915#msg126387

We have much better subinterpreter testing support now, so if this is
any area that you're interested in, one potential place to start would
be to get Antoine's patch back to a point where it applies and
compiles again.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-Dev mailing list