Quantcast
Channel: The Old New Thing
Viewing all articles
Browse latest Browse all 24428

re: How do I wait until all processes in a job have exited?

$
0
0

I wonder whether using the job handle as the completion key is entirely reliable.  I mean, the child process does not inherit the job handle, so if the child process also calls CreateJobObject, I'm afraid CreateJobObject could return the same handle value as in the parent process, even though the handle refers to a different job object.  I considered other ways to get unique completion keys (a LUID from AllocateLocallyUniqueId, or the process ID of the process that waits for the completion port), but these too require that all processes in the job allocate completion keys in the same way.

For JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO specifically, I guess I'd make the process first wait for the completion notification and check the completion key but then verify the situation with QueryInformationJobObject.


Viewing all articles
Browse latest Browse all 24428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>