VOOZH about

URL: https://thenewstack.io/python-to-drop-the-global-lock-for-greater-parallelism/

⇱ Python to Drop the Global Lock for Greater Parallelism - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2023-08-08 06:46:08
Python to Drop the Global Lock for Greater Parallelism
sponsor-celerdata,sponsored-topic,
Python

Python to Drop the Global Lock for Greater Parallelism

Big data user Meta has pledged three engineer years to creating a version of Python without global locks.
Aug 8th, 2023 6:46am by Joab Jackson
👁 Featued image for: Python to Drop the Global Lock for Greater Parallelism
Feature Image by Lynn Greyling from Pixabay.

In a move to ease use for large-scale data analysis work, the Python Steering Council has elected to drop the lock on Python that restricts a Python user program to using only a single thread. This restriction has become a serious performance impediment for running Python code across multicore CPUs, which is to say most all CPUs sold today.

Specifically, the Python global interpreter lock (“GIL”) prevents “multiple threads from executing Python code at the same time,” according to the proposal ”PEP 703 – Making the Global Interpreter Lock Optional in CPython.”

CPython is the reference implementation of Python.

In a poll of 46 committers, 87% agreed that Python should be made “free-threaded.”

No More GIL!
the Python team has officially accepted the proposal.

Congrats @colesbury on his multi-year brilliant effort to remove the GIL, and a heartfelt thanks to the Python Steering Council and Core team for a thoughtful plan to make this a reality.https://t.co/58QK2yctRD
— Soumith Chintala (@soumithchintala) July 30, 2023

Meta, the big data company behind Facebook and Instagram, is one company that is heartily behind the adoption of PEP 703, having committed three engineer years to building out a no-GIL Python.

On July 28, CPython core developer Thomas Wouters wrote that “We intend to accept PEP 703, although we’re still working on the acceptance details.”

Wouters proposed the rollout to happen in three stages. First, there will be an experimental build without the lock. Over time, support will be added for the GIL-less Python. In the final stage, the GIL-less Python will be default, with any vestiges of the GIL stripped away.

This timeline of course, will carry out over a period of years.

The Problem with GIL

“The GIL is a major obstacle to concurrency,” wrote Sam Gross in PEP 702. “The GIL introduces a global bottleneck that can prevent other threads from making progress if they call any Python code.”

This has been a major problem, for instance, in neural network-based AI models, which require many identical operations to run in parallel. Many other languages support this parallel capability, and it can be done within Python as well, through some customization.

GIL has brought other issues as well. Python libraries, for instance, are often made more complicated by GIL, necessitating needless complexity within API design. PyTorch, for instance, provides ways for Python AI models that avoid or work around the GIL entirely, though these hacks come with limitations. It also makes the interface for GPUs more complicated.

Is Python Getting too Complicated for New Users?
Efforts like the Cython project and the removal of the Global Interpreter Lock aim to gear Python for faster, high-throughput data analysis, but also introduce additional complexity.
No way: The improvements are much needed, backward compatible and optional to use.
0%
Yes: Python’s chief value is its simplicity, not its speed. Production can be executed with R, or C++ or some other performant language.
0%
Who cares? Python is too problematic even for new users (blank spaces, runaway libraries, etc.). Newbies, start with JavaScript instead.
0%
Cowboy Neal (h/t, Slashdot and Jack Kerouac)
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:

“Python’s global interpreter lock makes it difficult to use modern multicore CPUs efficiently for many scientific and numeric computing applications,” Gross summarized

How much work the move will require on existing libraries remains up for debate, as a recent Hacker News discussion shows. C and C++ libraries, or at least their interfaces, may have to be updated.

CelerData helps enterprises accelerate business growth with a unified analytics platform that delivers 3X the performance of any other solution on the market while reducing operating costs by up to 80%. Powered by StarRocks, CelerData is used worldwide by leading brands including Airbnb and Lenovo.
Learn More
The latest from CelerData

“The GIL does currently result in robust code by default because data can’t mutate underneath you. Without the GIL the code will appear to work, but it will be trivial for an attacker to use mutations to crash the code. Expect huge numbers of CVEs,” wrote one Python library contributor on the site.

CelerData helps enterprises accelerate business growth with a unified analytics platform that delivers 3X the performance of any other solution on the market while reducing operating costs by up to 80%. Powered by StarRocks, CelerData is used worldwide by leading brands including Airbnb and Lenovo.
Learn More
The latest from CelerData
TRENDING STORIES
Joab Jackson is a senior editor for The New Stack, covering cloud native computing and system operations. He has reported on IT infrastructure and development for over 30 years, including stints at IDG and Government Computer News. Before that, he...
Read more from Joab Jackson
SHARE THIS STORY
TRENDING STORIES
TNS owner Insight Partners is an investor in: Pragma.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.