New submission from Jesús Cea Avión <j...@jcea.es>:

After https://github.com/python/cpython/pull/18334, a "while condition: pass" 
in a thread will preclude releasing the GIL, hanging the program with CPU at 
100%.

Trivial to reproduce:

"""
#!/usr/bin/env python3.10

import threading
import time

def worker():
    while cont:
        pass

def main():
    global cont
    cont = True
    t = threading.Thread(target=worker)
    t.start()
    time.sleep(1)
    cont = False
    t.join()

if __name__ == '__main__':
    main()
"""

----------
keywords: 3.10regression
messages: 397549
nosy: Mark.Shannon, jcea, pablogsal
priority: release blocker
severity: normal
status: open
title: Python 3.10: Under some trivial circunstances, GIL not released
versions: Python 3.10

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44645>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to