<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/gh-116167-allow-disabling-the-gil-with-python-gil-0-or--x-gil-0-by-swtaarrs-pull-request-116-brk5jgbq9" -->

---
title: gh-116167: Allow disabling the GIL with `PYTHON_GIL=0`...
description: This post discusses the option to disable the GIL in Python using the PYTHON_GIL environment variable or the -X gil=0 flag. It mentions follow-up issues...
canonical: https://daily.dev/posts/gh-116167-allow-disabling-the-gil-with-python-gil-0-or--x-gil-0-by-swtaarrs-pull-request-116-brk5jgbq9
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: gh-116167: Allow disabling the GIL with `PYTHON_GIL=0` or `-X gil=0` by swtaarrs · Pull Request #116338 · python/cpython | daily.dev
og:description: This post discusses the option to disable the GIL in Python using the PYTHON_GIL environment variable or the -X gil=0 flag. It mentions follow-up issues...
og:url: https://daily.dev/posts/gh-116167-allow-disabling-the-gil-with-python-gil-0-or--x-gil-0-by-swtaarrs-pull-request-116-brk5jgbq9
og:image: https://api.daily.dev/og/posts/Brk5JgBq9.png
og:image:alt: gh-116167: Allow disabling the GIL with `PYTHON_GIL=0` or `-X gil=0` by swtaarrs · Pull Request #116338 · python/cpython
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# gh-116167: Allow disabling the GIL with `PYTHON_GIL=0` or `-X gil=0` by swtaarrs · Pull Request #116338 · python/cpython

**[Hacker News](https://daily.dev/sources/hn)** · 1 min read · 4 upvotes · 0 comments

## Summary

This post discusses the option to disable the GIL in Python using the PYTHON_GIL environment variable or the -X gil=0 flag. It mentions follow-up issues related to re-enabling the GIL when loading incompatible extensions and disabling the GIL by default. The impact of disabling the GIL on different programs is also mentioned.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://github.com/python/cpython/pull/116338>

---

Tags: [#python](https://daily.dev/tags/python), [#cpython](https://daily.dev/tags/cpython)

[View this post on daily.dev](https://daily.dev/posts/gh-116167-allow-disabling-the-gil-with-python-gil-0-or--x-gil-0-by-swtaarrs-pull-request-116-brk5jgbq9)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"gh-116167: Allow disabling the GIL with `PYTHON_GIL=0` or `-X gil=0` by swtaarrs · Pull Request #116338 · python/cpython","url":"https://daily.dev/posts/gh-116167-allow-disabling-the-gil-with-python-gil-0-or--x-gil-0-by-swtaarrs-pull-request-116-brk5jgbq9","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/gh-116167-allow-disabling-the-gil-with-python-gil-0-or--x-gil-0-by-swtaarrs-pull-request-116-brk5jgbq9"},"datePublished":"2024-03-11T17:01:26.994Z","dateModified":"2024-05-09T09:28:05.588Z","description":"This post discusses the option to disable the GIL in Python using the PYTHON_GIL environment variable or the -X gil=0 flag. It mentions follow-up issues...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/18fbc4ae68e5ffff68f4ba7be077a968?_a=AQAEufR","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/18fbc4ae68e5ffff68f4ba7be077a968?_a=AQAEufR","isAccessibleForFree":true,"articleSection":"Hacker News","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Hacker News","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/hn","url":"https://daily.dev/sources/hn"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/gh-116167-allow-disabling-the-gil-with-python-gil-0-or--x-gil-0-by-swtaarrs-pull-request-116-brk5jgbq9","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":4},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python,cpython","timeRequired":"PT1M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Hacker News","item":"https://daily.dev/sources/hn"},{"@type":"ListItem","position":3,"name":"gh-116167: Allow disabling the GIL with `PYTHON_GIL=0` or `-X gil=0` by swtaarrs · Pull Request #116338 · python/cpython"}]}
```

