I'm designing a cross-platform application that will be able to fork processes but I don't want it to be a big CPU eater. Anybody have a good way to do so reliably?
CPAN says Sys::Load fails on Windows quite a bit, though there might be something accessible by Win32::API. Now I'm thinking of checking how long it takes to execute a command as processes are added but I'm not sure this will reflect actual niceness wrt other apps. Any experience here?
One option I suppose would be to give up and just specify a maximum number of processes, like apache does in its config file. Or some kind of concurrent scheduler for which you can dial the relative niceness. But I'd rather have as little configuration and as much intelligence as possible. Pure perl would also be a plus.
The end result would automatically keep it down to a small number of processes on a slow machine (or maybe at a time when cpu load is high for some reason) but would not blink at launching many processes if resources are available. Thanks for your help.
Matt
In reply to Checking system cpu load when forking? by mattr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |