On Thu, 10 Mar 2022, 12:12 pm Eric Snow, <ericsnowcurrently@gmail.com> wrote:

On Wed, Mar 9, 2022 at 10:58 AM Petr Viktorin <encukou@gmail.com> wrote:
> This PEP definitely makes per-interpreter GIL sound possible :)


>
> “Main interpreter” should be defined.

+1

> (Or maybe the term should be
> avoided instead -- always having to spell out “interpreter started by
> Py_Initialize rather than Py_NewInterpreter” might push us toward
> finding ways to avoid the special case...)

We (me, Nick, Victor, others) have considered this in the past and
have concluded that having a distinct main interpreter is valuable.
That topic is a bit out of scope for this PEP though.


The PEP can mostly link to https://docs.python.org/3/c-api/init.html#sub-interpreter-support for the explanation of the main interpreter, and just include a partial paraphrase of those docs to give the gist of the idea. We added that info the last time we considered whether the main interpreter's "first among equals" status was necessary and decided it was.

For example, something based on the first and third sentences out of the docs explanation:

The “main” interpreter is the first one created when the runtime initializes. It continues to manage unique process-global responsibilities like signal handling even when other subinterpreters have been started.

Cheers,
Nick.



> >