<div dir="ltr">Hm... Curiously, I've heard a few people at PyCon mention they thought subinterpreters were broken and not useful (and they share the GIL anyways) and should be taken out. So we should at least have clarity on which direction we want to take...<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 24, 2017 at 6:01 PM, Eric Snow <span dir="ltr"><<a href="mailto:ericsnowcurrently@gmail.com" target="_blank">ericsnowcurrently@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Although I haven't been able to achieve the pace that I originally<br>
wanted, I have been able to work on my multi-core Python idea<br>
little-by-little.  Most notably, some of the blockers have been<br>
resolved at the recent PyCon sprints and I'm ready to move onto the<br>
next step: exposing multiple interpreters via a stdlib module.<br>
<br>
Initially I just want to expose basic support via 3 successive<br>
changes.  Below I've listed the corresponding (chained) PRs, along<br>
with what they add.  Note that the 2 proposed modules take some cues<br>
from the threading module, but don't try to be any sort of<br>
replacement.  Threading and subinterpreters are two different features<br>
that are used together rather than as alternatives to one another.<br>
<br>
At the very least I'd like to move forward with the _interpreters<br>
module sooner rather than later.  Doing so will facilitate more<br>
extensive testing of subinterpreters, in preparation for further use<br>
of them in the multi-core Python project.  We can iterate from there,<br>
but I'd at least like to get the basic functionality landed early.<br>
Any objections to (or feedback about) the low-level _interpreters<br>
module as described?  Likewise for the high-level interpreters module?<br>
<br>
Discussion on any expanded functionality for the modules or on the<br>
broader topic of the multi-core project are both welcome, but please<br>
start other threads for those topics.<br>
<br>
-eric<br>
<br>
<br>
basic low-level API: <a href="https://github.com/python/cpython/pull/1748" rel="noreferrer" target="_blank">https://github.com/python/<wbr>cpython/pull/1748</a><br>
<br>
  _interpreters.create() -> id<br>
  _interpreters.destroy(id)<br>
  _interpreters.run_string(id, code)<br>
  _interpreters.run_string_<wbr>unrestricted(id, code, ns=None) -> ns<br>
<br>
extra low-level API: <a href="https://github.com/python/cpython/pull/1802" rel="noreferrer" target="_blank">https://github.com/python/<wbr>cpython/pull/1802</a><br>
<br>
  _interpreters.enumerate() -> [id, ...]<br>
  _interpreters.get_current() -> id<br>
  _interpreters.get_main() -> id<br>
  _interpreters.is_running(id) -> bool<br>
<br>
basic high-level API: <a href="https://github.com/python/cpython/pull/1803" rel="noreferrer" target="_blank">https://github.com/python/<wbr>cpython/pull/1803</a><br>
<br>
  interpreters.enumerate() -> [Interpreter, ...]<br>
  interpreters.get_current() -> Interpreter<br>
  interpreters.get_main() -> Interpreter<br>
  interpreters.create() -> Interpreter<br>
  interpreters.Interpreter(id)<br>
  interpreters.Interpreter.is_<wbr>running()<br>
  interpreters.Interpreter.<wbr>destroy()<br>
  interpreters.Interpreter.run(<wbr>code)<br>
______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/<wbr>codeofconduct/</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div>