Ignore:
Timestamp:
Mar 18, 2018, 9:10:03 PM (7 years ago)
Author:
bird
Message:

kmk/win: Reworking child process handling. This effort will hopefully handle processor groups better and allow executing internal function off the main thread.

Location:
trunk/src/kmk/kmkbuiltin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/kmkbuiltin/kSubmit.c

    r3140 r3156  
    5151#endif
    5252#ifdef KBUILD_OS_WINDOWS
    53 # include "sub_proc.h"
     53# ifndef CONFIG_NEW_WIN_CHILDREN
     54#  include "sub_proc.h"
     55# else
     56#  include "../w32/winchildren.h"
     57# endif
    5458#endif
    5559
     
    933937    if (rc == -1)
    934938    {
     939# ifndef CONFIG_NEW_WIN_CHILDREN
    935940        if (process_kmk_register_submit(pWorker->OverlappedRead.hEvent, (intptr_t)pWorker, pPidSpawned) == 0)
    936941        { /* likely */ }
     
    942947            goto l_again;
    943948        }
     949# else
     950        if (MkWinChildCreateSubmit((intptr_t)pWorker->OverlappedRead.hEvent, pWorker, pPidSpawned) == 0)
     951        { /* likely */ }
     952        else
     953        {
     954            /* We need to do the waiting here because sub_proc.c has too much to do. */
     955            warnx("MkWinChildCreateSubmit failed!");
     956            WaitForSingleObject(pWorker->OverlappedRead.hEvent, INFINITE);
     957            goto l_again;
     958        }
     959# endif
    944960    }
    945961    else
  • trunk/src/kmk/kmkbuiltin/redirect.c

    r3145 r3156  
    7070#include "kmkbuiltin.h"
    7171#ifdef KMK
     72# include "job.h"
     73# include "variable.h"
    7274# ifdef KBUILD_OS_WINDOWS
    73 #  include "sub_proc.h"
     75#  ifndef CONFIG_NEW_WIN_CHILDREN
     76#   include "sub_proc.h"
     77#  else
     78#   include "../w32/winchildren.h"
     79#  endif
    7480#  include "pathstuff.h"
    7581# endif
    76 # include "job.h"
    77 # include "variable.h"
    7882#endif
    7983
     
    888892                if ((intptr_t)hProcess != -1)
    889893                {
     894# ifndef CONFIG_NEW_WIN_CHILDREN
    890895                    if (process_kmk_register_redirect(hProcess, pPidSpawned) == 0)
     896# else
     897                    if (MkWinChildCreateRedirect((intptr_t)hProcess, pPidSpawned) == 0)
     898# endif
    891899                    {
    892900                        if (cVerbosity > 0)
     
    896904                    {
    897905                        DWORD dwTmp;
     906# ifndef CONFIG_NEW_WIN_CHILDREN
    898907                        warn("sub_proc is out of slots, waiting for child...");
     908# else
     909                        warn("MkWinChildCreateRedirect failed...");
     910# endif
    899911                        dwTmp = WaitForSingleObject(hProcess, INFINITE);
    900912                        if (dwTmp != WAIT_OBJECT_0)
Note: See TracChangeset for help on using the changeset viewer.