Skip to content

multiprocessing.connection.wait high CPU load with empty object_list #145587

@danielhrisca

Description

@danielhrisca

Bug report

Bug description:

 from multiprocessing.conenction import wait
 import os
 from time import time
 
 print(os.getpid())
 start = t
 
 while True:

    for pipe in wait([], 1):
        pass
    print(time()-t)

multiprocessing.connection.wait causes 100% CPU load if the object list is empty; otherwise the CPU load very low

CPython versions tested on:

3.12

Operating systems tested on:

Windows

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-windowsstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions