views:

174

answers:

2

In short, I want to find windows equivalent way of unix setrusage() function.

Can I limit resource usage for particular process? For example, 10 seconds cpu time and 50mb memory size. If the process run more than 10 seconds or consumes more than 50mb memory, the process will be terminated by windows.

+3  A: 

Try job objects! They even work for groups of processes and spawned processes. I think you can do all these limits using them

Here is more information http://msdn.microsoft.com/en-us/library/ms684161.aspx

Christian
+1  A: 

Look at the documentation for SetInformationJobObject.

Roger Lipscombe