The Vivandiere
The Vivandiere

Reputation: 3201

What is the equivalent of POSIX's group ID on Windows?

When analyzing the process tree in C++, POSIX allows you to prune it using group ID. Several processes may be added to a particular group.

Eg. see the following POSIX function.

add my process to a group

Does Windows have an equivalent of the above? I would like to assign a bunch of processes I own to a group, and then control the group as a whole.

Eg.

kill all processes in my group

Upvotes: 1

Views: 297

Answers (1)

Artyer
Artyer

Reputation: 40911

Windows has process groups which each newly created child process is added to unless it is created with the CREATE_NEW_PROCESS_GROUP flag. This is only useful for the GenerateConsoleCtrlEvent function as far as I know.

Job objects might be more useful to you. For example, you can kill all process associated with a given job with TerminateJobObject.

Upvotes: 2

Related Questions