From b04468bb912d9635fe5f3965b15678add8046f58 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 23 Feb 2010 15:48:44 -0500 Subject: [PATCH] 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. --- parallel.c | 2 +- parallel.docbook | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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. -- 2.39.5