]> err.no Git - moreutils/commitdiff
fix load edge case
authorJoey Hess <joey@gnu.kitenet.net>
Tue, 23 Feb 2010 20:48:44 +0000 (15:48 -0500)
committerJoey Hess <joey@gnu.kitenet.net>
Tue, 23 Feb 2010 20:48:44 +0000 (15:48 -0500)
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
parallel.docbook

index 72f1426541972729a9cf8b9d3b7188e6c28e6d7a..0146a13b99beee2b2c0d45fde2039c4e58de394a 100644 (file)
@@ -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 */
index b09350d3936847467354454846c0b78df97a7d87..955c2d610fe6a6f49bf3f46504e8908a55cc1bd2 100644 (file)
@@ -78,8 +78,8 @@ Written by Joey Hess
                        <term><option>-l maxload</option></term>
                        <listitem>
                                <para>Avoid starting new jobs when
-                               the system's load average is higher
-                               than the specified limit.</para>
+                               the system's load average is not below
+                               the specified limit.</para>
                        </listitem>
                </varlistentry>