Litmus Testing CPython Without the Global Interpreter Lock

Saved in:
Bibliographic Details
Published in:ProQuest Dissertations and Theses (2025)
Main Author: Siddiqui, Ali
Published:
ProQuest Dissertations & Theses
Subjects:
Online Access:Citation/Abstract
Full Text - PDF
Tags: Add Tag
No Tags, Be the first to tag this record!
Description
Abstract:CPython’s Global Interpreter Lock (GIL) has been a long-standing performance bottleneck for the Python programming language, forcing Python threads to run one at a time and preventing real shared memory parallelism in Python programs. Recently, the Python Steering Council has accepted Python Enhancement Proposal (PEP) 703, which aims to eliminate the GIL and bring real multithreading to CPython for the first time. An experimental “free-threaded” version of CPython implementing PEP 703 is now being actively developed by the core CPython team. This thesis describes our efforts to characterize the memory model of free-threaded CPython. We argue that as a consequence of the GIL, CPython has historically enforced an extremely strong memory model, Sequential Consistency (SC), and that the implementers of PEP 703 must be careful to maintain backwards compatibility with this memory model. We use litmus tests to examine the memory consistency guarantees free-threaded CPython offers to Python programs, and we apply a simple form of mutation testing to free-threaded CPython to validate our litmus testing approach. While we find that free-threaded CPython currently preserves SC, we believe that the testing methodology we develop in this thesis can be used to ensure adherence to SC for future versions of free-threaded CPython as well. 
ISBN:9798280767164
Source:ProQuest Dissertations & Theses Global