Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
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
Diff view
Diff view
8 changes: 8 additions & 0 deletions Lib/multiprocessing/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,14 @@ def wait(object_list, timeout=None):

Returns list of those objects in object_list which are ready/readable.
'''
if not object_list:
Comment thread
Shrey-N marked this conversation as resolved.
if timeout is None:
while True:
time.sleep(1e6)
elif timeout > 0:
time.sleep(timeout)
return []

if timeout is None:
timeout = INFINITE
elif timeout < 0:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Resolved a performance regression in ``multiprocessing.connection.wait`` on Windows that caused infinite busy loops when called with no objects. The function now properly yields control to the OS to conserve CPU resources.
Loading