31 October 2026 to 2 November 2026
Terengganu Digital 1303
Asia/Kuala_Lumpur timezone

Tying Up Loose Threads: Making your Project No-GIL Ready

Not scheduled
20m
Terengganu Digital 1303

Terengganu Digital 1303

TD1303 Jalan Sultan Zainal Abidin 20000 Kuala Terengganu Terengganu Darul Iman
30 minutes presentation: IN PERSON

Speaker

Charlie Lin

Description

Python's Global Interpreter Lock, which determines which single thread can execute native Python code and call C API functions, simplifies writing multithreaded code. However, sticking with this execution model leaves out extra performance afforded by modern multicore CPUs with hyperthreading, as automatic locking and unlocking of the GIL does not scale well with thread counts, especially in performance-sensitive workloads.

The newfangled free-threaded interpreter promises salvation when running either pure Python code or with compiled extensions. General multithreading rules apply (prefer thread-local variables, using locks to prevent simultaneous access of shared data), but when dealing with projects containing compiled extensions that directly or indirectly interface with Python's C API, more porting rules also apply.

Key porting tips, including projects using the Limited API, include: modify unit tests to catch concurrency bugs arising from assuming the presence of the GIL; and extend CI coverage of Python interpreters both for testing and to build free-threaded compatible wheels.

Author(s) Bio

I am a free-lance OSS contributor, and a graduate from a little-known private arts college known as Rollins College. I am rather fond of subjecting myself to testing bleeding-edge unstable software daily.

I yearn in attaining as much online privacy as possible. In particular, I use privacy.sexy for debloating my Windows install and route all DNS requests to servers that support encrypted DNS over HTTPS.

Talk Description

This talk will equip Python developers with hands-on porting strategies for Pythons free-threaded interpreter (-Xgil), from adding trove classifiers and Limited API support (PEP 803) to hardening extensions like pyo3, numpy, cffi against concurrency bugs via locks, atomics, and pytest-run-parallel CI. It turns GIL lock contention into multicore scaling for real workloads, a must for cloud-native performance.

Across Python ecosystems, it accelerates free-threaded adoption in containerized ML pipelines, serverless functions, and observability agents, shrinking tail latencies and unlocking hyperthreaded gains. Maintainers walk away ready to ship GIL-free wheels, hardening the next wave of cloud-native Python tools against the multicore reality.

Category Application Development and Deployment
Where are you located? USA
Do you need travel sponsorship from GNOME Foundation in order to join our event? Yes

Author

Presentation materials