This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jcea
Recipients Mark.Shannon, jcea, pablogsal
Date 2021-07-15.13:26:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1626355567.97.0.494557003743.issue44645@roundup.psfhosted.org>
In-reply-to
Content
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()
"""
History
Date User Action Args
2021-07-15 13:26:08jceasetrecipients: + jcea, Mark.Shannon, pablogsal
2021-07-15 13:26:07jceasetmessageid: <1626355567.97.0.494557003743.issue44645@roundup.psfhosted.org>
2021-07-15 13:26:07jcealinkissue44645 messages
2021-07-15 13:26:07jceacreate