Software Development

How are you handling the transition to Python 3.12 and the GIL changes?

B Asked by Brian Collins · 05-11-2023
0 upvotes 9,518 views 0 comments
The question

With Python 3.12 out and the ongoing discussions about the Global Interpreter Lock (GIL) being optional in future versions, how is your dev team preparing? We rely heavily on multi-threading for data processing, and I'm wondering if we should stick to multiprocessing or wait for the "nogil" builds to mature. 

3 answers

0
CY
Answered on 10-11-2023

We are currently sticking with the multiprocessing module for any heavy CPU-bound tasks. While the "nogil" movement is exciting, it's still experimental and could introduce subtle thread-safety bugs in third-party C-extensions like NumPy or Pandas. For Python 3.12, we’ve focused more on leveraging the new f-string improvements and the performance boosts in the garbage collector. My strategy is to wait until at least 3.13 or 3.14 before we even consider refactoring our core threading logic to rely on a GIL-free environment.

0
GR
Answered on 15-11-2023

Have you noticed any significant performance regressions in 3.12 with older libraries, or has the backward compatibility been as solid as advertised?

BR 22-11-2023

I agree with Deborah. Using Rust for the heavy lifting while keeping the business logic in Python is the "Gold Standard" right now. It completely bypasses the GIL headache.

0
DE
Answered on 20-11-2023

We actually moved our most performance-critical paths to Rust via PyO3. It’s much safer than waiting for the GIL changes to solve our concurrency issues. 

BR 22-11-2023

I agree with Deborah. Using Rust for the heavy lifting while keeping the business logic in Python is the "Gold Standard" right now. It completely bypasses the GIL headache.

Share your thoughts

Your email address will not be published. Required fields are marked (*)

Professional Counselling Session

Still have questions?
Schedule a free counselling session

Our experts are ready to help you with any questions about courses, admissions, or career paths. Get personalized guidance from industry professionals.

Request a Call Back

Search Online

We Accept

We Accept

Follow Us

"PMI®", "PMBOK®", "PMP®", "CAPM®" and "PMI-ACP®" are registered marks of the Project Management Institute, Inc. | "CSM", "CST" are Registered Trade Marks of The Scrum Alliance, USA. | COBIT® is a trademark of ISACA® registered in the United States and other countries.

Book Free Session