Skip to content

Busy looping when waiting for subprocess to finish #70

@landersson

Description

@landersson

Hi,

I just noticed that my program is busy-looping and thus using up a lot of CPU resources while waiting for a subprocess to finish. I'm using the Popen class. The root cause seems to be that waitpid() is used with the WNOHANG option in the util::wait_for_child_exit(int pid) function.

Why is WNOHANG being used? Is there a way to avoid busy-looping while waiting for a subprocess to finish?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions