8000 gh-116749: Disable GIL by default in free-threaded build by colesbury · Pull Request #118295 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-116749: Disable GIL by default in free-threaded build #118295

8000
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
8000
Diff view
Diff view
Next Next commit
gh-116749: Disable GIL by default in free-threaded build
Switch GIL to disabled by default in free-threaded build so that the
free-threaded CIs catch thread-safety issues.
  • Loading branch information
colesbury committed Apr 25, 2024
commit 9fc88f42e04bc228f0fa359c324d0fd93cf18d7e
2 changes: 1 addition & 1 deletion Lib/test/test_cmd_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ def test_pythondevmode_env(self):
def test_python_gil(self):
cases = [
# (env, opt, expected, msg)
(None, None, 'None', "no options set"),
(None, None, '0', "no options set"),
('0', None, '0', "PYTHON_GIL=0"),
('1', None, '1', "PYTHON_GIL=1"),
('1', '0', '0', "-X gil=0 overrides PYTHON_GIL=1"),
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
if support.Py_DEBUG:
CONFIG_COMPAT['run_presite'] = None
if support.Py_GIL_DISABLED:
CONFIG_COMPAT['enable_gil'] = -1
CONFIG_COMPAT['enable_gil'] = 0
if MS_WINDOWS:
CONFIG_COMPAT.update({
'legacy_windows_stdio': 0,
Expand Down
2 changes: 1 addition & 1 deletion Python/initconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ _PyConfig_InitCompatConfig(PyConfig *config)
config->code_debug_ranges = 1;
config->cpu_count = -1;
#ifdef Py_GIL_DISABLED
config->enable_gil = _PyConfig_GIL_DEFAULT;
config->enable_gil = _PyConfig_GIL_DISABLE;
#endif
}

Expand Down
Loading
0