This article https://devblogs.microsoft.com/oldnewthing/20130405-00/?p=4743 explains how one can wait the complete process tree to be terminated in a Windows job unit, for example after issueing the termination.
However, the docs note https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-jobobject_associate_completion_port?redirectedfrom=MSDN
Note that, except for limits set with the JobObjectNotificationLimitInformation information class, messages are intended only as notifications and their delivery to the completion port is not guaranteed. The failure of a message to arrive at the completion port does not necessarily mean that the event did not occur. Notifications for limits set with JobObjectNotificationLimitInformation are guaranteed to arrive at the completion port
This sounds like realtime signal queues on posix systems, where signals are dropped, if buffer runs full.
Is there another more reliable notification method for this?
The question is insofar related, as Zig provides for windows CreateIoCompletionPort and I'd like to know conditions for data drops and/or where to find docs on edge case behavior.
A: Besides signaling the processes, the processes may exit in a regular way, which makes the I/O completion port usage necessary https://devblogs.microsoft.com/oldnewthing/20130405-00/?p=4743
but this is not reflected in the docs of WaitForSingleObjectEx:
Waits until the specified object is in the signaled state, an I/O completion routine or asynchronous procedure call (APC) is queued to the thread, or the time-out interval elapses.
However, this does not explain why TerminateJobObject is not applied or not observable in QeryInformationJobObject.
I suspect that Wait does also execute the enqueued job object "things to do" and GetQueuedCompletionStatus does the same.
However, this is not documented.