home.social

#subinterpreters — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #subinterpreters, aggregated by home.social.

  1. Subinterpreters в Python 3.14: альтернатива multiprocessing с честным мультикором

    Привет, Хабр! В C/C++ давно принято встраивать Python в приложения для скриптовой логики и плагинов. Именно эта экосистема много лет давала повод развивать в CPython идею нескольких изолированных интерпретаторов в одном процессе. Долгое время это было только в C-API: создаёшь новый интерпретатор через Py_NewInterpreter , живёшь с одним общим GIL и кучей глобального состояния. В Python 3.12 появилось ключевое изменение — GIL стал на-интерпретатор (каждый subinterpreter со своим GIL), но доступ был только через C-API. В 3.14 подвезли полноценный высокоуровневый Python-API: модуль concurrent.interpreters и InterpreterPoolExecutor . Теперь можно писать параллельный код без multiprocessing , но с изоляцией уровня «почти процесс». Дальше разберёмся, что это такое, когда это уместно вместо multiprocessing .

    habr.com/ru/companies/otus/art

    #PYTHON #Python_314 #subinterpreters #InterpreterPoolExecutor #concurrentinterpreters #мультипоточность #GIL

  2. Just released: Python 3.14.0 beta 3! 🚀🐍

    🥧 All the good stuff of b2 but also:

    🥧 Free-threaded Python is officially supported! (PEP 779)

    🥧 Subinterpreters in the stdlib! (PEP 734)

    Do you maintain a Python package? Please test 3.14.

    If you find a bug now, we can fix it before October, which helps everyone. And you might find some places in your code to update as well, which helps you.

    discuss.python.org/t/python-3-

    #Python #CPython #Python314 #release #PEP779 #PEP734 #FreeThreaded #subinterpreters