Subprocesses support
Status: Beta
Brought to you by:
bhackerozzo
cpulimit doesn't limit the cpu usage of the
subprocesses (but the threads here works ok)
I'm attaching a patch that implements that, and
also implements the multiple processes of feature
request 1875300 (mostly as side-effect)
NOTE: The patch of the Makefile is because of function
memrchr, that depends on -D_GNU_SOURCE
Felipe3
cpulimit.c patch
Makefile patch
Logged In: YES
user_id=1565621
Originator: YES
File Added: Makefile.patch
Logged In: YES
user_id=1183789
Originator: NO
Now subprocesses are limited too. Check out the code from svn.
Your children detection algorithm is simple but heavy when there are a lot of children, because for each scanned process it checks if it is child of each member of the "family". So I've done an implementation using an hashtable for processes (like in the kernel), so I know in O(1) if a process is member of the family or not.
Thanks for the note ;)
Angelo