From: Joey Hess Date: Tue, 23 Feb 2010 20:48:44 +0000 (-0500) Subject: fix load edge case X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b04468bb912d9635fe5f3965b15678add8046f58;p=moreutils fix load edge case If load == maxload, it would not start a job, but also not sleep. That could, in theory, make parallel spin for a bit. Also, clarify docs. --- diff --git a/parallel.c b/parallel.c index 72f1426..0146a13 100644 --- a/parallel.c +++ b/parallel.c @@ -217,7 +217,7 @@ int main(int argc, char **argv) { curjobs--; } - if (maxload > 0 && load > maxload) { + if (maxload > 0 && load >= maxload) { int r; sleep(1); /* XXX We should have a better * heurestic than this */ diff --git a/parallel.docbook b/parallel.docbook index b09350d..955c2d6 100644 --- a/parallel.docbook +++ b/parallel.docbook @@ -78,8 +78,8 @@ Written by Joey Hess Avoid starting new jobs when - the system's load average is higher - than the specified limit. + the system's load average is not below + the specified limit.