GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Unfixable potential race conditions on file descriptors in CPython · Issue #121544 · python/cpython Closed as not planned Closed as not planned Copy link Labels DescriptionPython allows multiple threads to concurrently access file descriptors through files and sockets. Race conditions at the Python level can lead to unexpected behavior, even with the global interpreter lock. Thread sanitizer reports these races in some of our tests that exercise this behavior. We cannot fix these potential race conditions without introducing potential deadlocks. For example, consider: import threading secrets = open("secrets.txt", "w"); def thread1(): secrets.write("a secret") def thread2(): secrets.close() def thread3(): with open("log.txt", "w") as log: log.write("log message") threading.Thread(target=thread1).start() threading.Thread(target=thread2).start() threading.Thread(target=thread3).start() If you are particularly unlucky, then the file descriptor for This can happen, even with the GIL, because the GIL is released around
Note that we must release the GIL before calling Reacted by Michael Droettboom, Kirill Podoprigora and sobolevn Activity
MetadataMetadataAssigneesLabelsProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |