joyent/libuv — pull request #338 by eladb (2012-03-08 18:21:05+00:00)
Title: Process trees on Windows

On Windows, the default behavior for child processes is not to be killed
when their parent die. This is different from the behavior of most platforms.

This change uses [Windows Job Objects](http://msdn.microsoft.com/en-us/library/windows/desktop/ms684161(v=vs.85).aspx)
to implement the same behavior for Windows.

A test named `spawn_tree` was added to verify this behavior: the test spawns
a child and a grandchild. The child exits after 200ms and the grandchild
asserts after 5 seconds. If the process tree is constructed propertly, the
child should kill the grandchild and then the assertion is not hit.

Credits: @saary, @yosefd, [iisnode](https://github.com/tjanczuk/iisnode)