Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use waitpid to iterate over all exited child processes #122

Merged
merged 11 commits into from Aug 23, 2019

Commits on Aug 23, 2019

  1. Fix indentation style.

    s-ludwig committed Aug 23, 2019
    Configuration menu
    Copy the full SHA
    e1c6d99 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    507fb5a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    de199d3 View commit details
    Browse the repository at this point in the history
  4. Return an invalid wait ID for processes.wait() if the process has alr…

    …eady exited.
    
    Avoids overlap with valid wait IDs, so that a paired cancelWait() doesn't cancel a different wait.
    s-ludwig committed Aug 23, 2019
    Configuration menu
    Copy the full SHA
    72234fc View commit details
    Browse the repository at this point in the history
  5. Avoid interference with other users of waitpid.

    Instead of using waitpid(-1), explicitly waits on all known processes. This is inefficient for large numbers of child processes, but seems to be the only way to ensure to not interfere with other code that uses waitpid().
    s-ludwig committed Aug 23, 2019
    Configuration menu
    Copy the full SHA
    4724f14 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    1ef320c View commit details
    Browse the repository at this point in the history
  7. Rework the child process exit code to not rely in SIGCHLD.

    It turns out that in a heterogeneous process where other parts of the code may start processes or threads and may be waiting for those to finish, it is not realistic to rely on signalfd or even SIGCHLD in general to get notified about child process exits. The only solid way appears to be to start a separate waiter thread that uses waitid/waitpid to wait for exited child processes in a blocking way.
    
    This also fixes the hanging vibe.core.process test in vibe-core with DMD 2.087.x.
    s-ludwig committed Aug 23, 2019
    Configuration menu
    Copy the full SHA
    7ebad49 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    f1c2eb7 View commit details
    Browse the repository at this point in the history
  9. Fix Windows compilation.

    Integrates the contents of StaticProcesses into PosixEventDriverProcesses to fully hide it form the Windows build. It also changes lockedProcessInfo to be a non-template function, as that lead to a linker error on macOS.
    s-ludwig committed Aug 23, 2019
    Configuration menu
    Copy the full SHA
    01c2c26 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    5c3afcc View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    20373d1 View commit details
    Browse the repository at this point in the history