4 ms·
This is seriously cool idea. But could you not get the same effect with nice?
by emilfihlman 8y ago
This is seriously cool idea.
But could you not get the same effect with nice?
- c0l0 8y agoNo, you cannot. A given task, running at maximum "niceness" (i.e., the lowest "priority" in regard to its peers) will happily consume 100% CPU if it has enough work to do - at least in total absence of other consumers of that resource. SIGSTOP effectively tells the scheduler to just not allocate any CPU time to the task any more, which makes the task unable to perform any work (and also not consume any additional resources, of course).
- comboy 8y agoAwesome, for those of you wondering just like me - it's SIGCONT.
- vermaden 8y agoThanks. The `nice` (or also `idprio` on FreeBSD) will only lower the priotiry in the queue for CPU time, which means that if nothing else will need CPU it will still get as much CPU time as it wants, thus still eating battery time.
- kjeetgill 8y agoSigstop is pulling the car over. Nice is like pulling over if there's other traffic on the road but going full speed ahead if it's empty.