Skip to content
Snippets Groups Projects
Forked from Glasgow Haskell Compiler / GHC
Source project has a limited visibility.
  • Tamar Christina's avatar
    d0bab2e3
    SysTools: Use "process job" when spawning processes on Windows · d0bab2e3
    Tamar Christina authored and Ben Gamari's avatar Ben Gamari committed
    GHC should make calls using process jobs when calling out to GCC and LD.
    The reason is these use the exec () family of posix functions.  Window's
    process model doesn't allow replacement of processes so this is emulated
    by creating a new process and immediately exiting the old one.  Because
    of this when using normal Windows wait functions you would return even
    without the child process having finished.  In this case if you are
    depending on data from the child you will enter a race condition.
    
    The usual fix for this is to use process jobs and wait for the
    termination of all children that have ever been spawn by the process you
    called. But also waiting for the freeing of all resources.
    
    (cherry picked from commit 584eee71)
    d0bab2e3
    History
    SysTools: Use "process job" when spawning processes on Windows
    Tamar Christina authored and Ben Gamari's avatar Ben Gamari committed
    GHC should make calls using process jobs when calling out to GCC and LD.
    The reason is these use the exec () family of posix functions.  Window's
    process model doesn't allow replacement of processes so this is emulated
    by creating a new process and immediately exiting the old one.  Because
    of this when using normal Windows wait functions you would return even
    without the child process having finished.  In this case if you are
    depending on data from the child you will enter a race condition.
    
    The usual fix for this is to use process jobs and wait for the
    termination of all children that have ever been spawn by the process you
    called. But also waiting for the freeing of all resources.
    
    (cherry picked from commit 584eee71)
Code owners
Assign users and groups as approvers for specific file changes. Learn more.