Isolate Python Subinterpreters

 — 
Christmas gift.

This article is about the work done in Python in 2019 and 2020 to better isolate subinterpreters. Static types are converted to heap types, extension modules are converted to use the new multiphase initialization API (PEP 489), caches, states, singletons and free lists are made per-interpreter, many bugs have been …

Category: cpython Tags:

Hide implementation details from the Python C API

 — 
My cat attacking the Python C API

This article is the history of Python C API discussions over the last 4 years, and the creation of C API projects: pythoncapi website, pythoncapi_compat.h header file and HPy (new clean C API). More and more people are aware of issues caused by the C API and are working …

Category: cpython Tags:

Leaks discovered by subinterpreters

 — 

This article is about old reference leaks discovered or caused by the work on isolating subinterpreters: leaks in 6 different modules (gc, _weakref, _abc, _signal, _ast and _thread).

_thread GC bug

Refleaks buildbot failures

With my work on isolating subinterpreters, old bugs about Python objects leaked at Python exit are suddenly becoming blocker …

Category: cpython Tags:

GIL bugfixes for daemon threads in Python 3.9

 — 
`#CoronaMaison by Boulet

My previous article Daemon threads and the Python finalization in Python 3.2 and 3.3 introduces issues caused by daemon threads in the Python finalization and past changes to make them work.

This article is about bugfixes of the infamous GIL (Global Interpreter Lock) in Python 3.9, between …

Category: cpython Tags:

Threading shutdown race condition

 — 

This article is about a race condition in threading shutdown that I fixed in Python 3.9 in March 2019. I also forbid spawning daemon threads in subinterpreters to fix another related bug.

#CoronaMaison by Julien Neel

Drawing: #CoronaMaison by Julien Neel.

Race condition in threading shutdown

Random test failure noticed on FreeBSD buildbot …

Category: cpython Tags:

Daemon threads and the Python finalization in Python 3.2 and 3.3

 — 
#CoronaMaison by Luppi

At exit, the Python finalization calls Python objects finalizers (the __del__() method) and deallocates memory. The daemon threads are a special kind of threads which continue to run during and after the Python finalization. They are causing race conditions and tricky bugs in the Python finalization.

This article covers bugs …

Category: cpython Tags:

Python 3.7 Development Mode

 — 
Ready to race

This article describes the discussion on the design of the development mode (-X dev) that I added to Python 3.7 and how it has been implemented.

The development mode enables runtime checks which are too expensive to be enabled by default. It can be enabled by python3 -X dev …

Category: python Tags:

Pass the Python thread state explicitly

 — 
Python C API

Keeping Python competitive

I'm trying to find ways to make Python more efficient for many years, see for example my discussion at the Language Summit during Pycon US 2017: Keeping Python competitive (LWN article); slides. At EuroPython 2019 (Basel), I gave the keynote "Python Performance: Past, Present and Future": slides …

Category: python Tags:

Graphics bugs in Firefox and GNOME

 — 

After explaining how to Debug Hybrid Graphics issues on Linux, here is the story of four graphics bugs that I had in GNOME and Firefox on my Fedora 30 between May 2018 and September 2019: bugs in gnome-shell, Gtk, Firefox and mutter.

Glitch

gnome-shell freezes

In May 2018, six months after …

Category: linux Tags:

Debug Hybrid Graphics issues on Linux

 — 

Hybrid Graphics is a complex hardware and software solution to achieve longer laptop battery life: an integrated graphics device is used by default, and a discrete graphics device with higher graphics performances is enabled on demand.

Hybrid Graphics

If it is designed and implemented carefully, users should not notice that a laptop …

Category: linux Tags:

© Victor Stinner 2016

Powered by Pelican