trio icon indicating copy to clipboard operation
trio copied to clipboard

Making the use of Multiple interpreters simple

Open stonebig opened this issue 2 years ago • 3 comments

Woudn't it be interesting for the "simplicity of usage" minds behind trio to look on how to exploit multiple-interpreters ? Python-3.12 is upon us but there won't be any meaningfull standard use of multiple interpreters till 3.13 .... it would look like a perfect space window for imagination again.

it's a bit like writing to santa, but who knows.

stonebig avatar Jun 17 '23 11:06 stonebig

For a bit of context this has been discussed on the Gitter a bit (regarding nogil specifically) and the conclusions from that seem to be that trio makes the wrong kinda APIs available? Or at least that somewhat foundational assumptions would be made incorrect (like atomicity between awaits).

It's still something to think about however. Just adding that as context, not to shut this down! Here's a quote from @njsmith on the Gitter:

I don't expect we're ever going to announce that surprise, now every trio program/library is broken because we're going to start scheduling everyone across multiple threads

A5rocks avatar Jun 17 '23 13:06 A5rocks

Dropping the GIL means that Python in multiple threads can run faster, but basically isn't that all that changes? You want to run multiple Trio threads, you need to add locks to the state they share, gil or not doesn't much matter.

Of course, as long as we do have the GIL, there's not much point doing this in the first place …

smurfix avatar Jun 18 '23 07:06 smurfix

Nogil apparently won't happen, you keep the GIL next 3 years. But now you can have multiple interpreters running and exchanging messages.

stonebig avatar Jun 18 '23 08:06 stonebig