3 ms·
Threads and processes can be given a lower priority. Edit for @barrkel: you can also do more advanced resource shaping on some OSen. Like limiting the number
by illumen 14y ago
Threads and processes can be given a lower priority.
Edit for @barrkel: you can also do more advanced resource shaping on some OSen. Like limiting the number of network connections per second, and limiting the bandwidth. There are also cpu throttling possibilities where you can make sure a process only runs max 10% of cpu. Or as you say, putting scheduling into the app is another possibility.
- barrkel 14y agoLower priority does nothing to throttle activity unless there is a higher priority thread available to run; if the machine is otherwise idle, lowest priority threads will use 100% of CPU resources. If you want to avoid high CPU graphs, whirring fans from increased heat, etc., you need to make the thread or process sleep occasionally. For a thread, that's best done with explicit coding; for a process that isn't sharing resources with other processes, you can get away with more invasive freezing from the outside.
- agumonkey 14y agoI guess it's possible to code a tiny arbiter that will wake 'background' thread every few ms.