There are job objects which are similar to Linux cgroups, including the ability to set a limit on the number of processes. But I'm not sure if that limit will be tripped in this case or not because the child processes have exited, whereas the job object parameter is specifically called LIMIT_
ACTIVE_PROCESS
https://learn.microsoft.com/en-us/windows/win32/procthread/j...
https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns...