JuliaCon 2025

Lead, follow, or get out of the way: Julia and threaded Python
2025-07-25 , Main Room 6

PythonCall.jl and juliacall have recently added support for using multithreaded Julia code from Python, or calling Python code from Julia threads. However, there are still quite a few gotchas. In this talk I will discuss some pitfalls encountered when developing a Python wrapper for a multithreaded Julia package and demonstrate workarounds and some suggestions for other package developers encountering similar issues.


Although Julia aims to address the "two language problem" - using a high performance language like C, C++, or FORTRAN "under the hood" but writing interfaces in Python - user and institutional reluctance to embrace Julia means there's demand for Python wrappers around Julia packages. Python's threading model makes interoperability with Julia threads complex, and can hamstring performance of threaded Julia code. In this talk I will explain how and why these problems arise, some possible workarounds coming in Python, and how developers today can work around these pitfalls when creating Python wrappers for their high performance Julia code. Another goal of the talk is to stimulate discussion of what can be done in code our community controls (e.g. PythonCall.jl and juliacall) to make this easier for developers and wrapper writers.

I am a Julia contributor since 2015. I work mostly on GPUs, quantum packages, and linear algebra.

This speaker also appears in: