[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: load average and parallel execution

From: Eli Zaretskii
Subject: Re: load average and parallel execution
Date: Mon, 17 Jan 2011 09:36:26 -0500

> Date: Mon, 17 Jan 2011 17:54:47 +0330
> From: ali hagigat <address@hidden>
> Cc: 
> -l 2.5
> will not let make start more than one job if the load average is above 2.5.
> ---------------------------------------
> What does this sentence mean? It means if our load average is 3 for
> example, then make starts one job but not more than one job at that
> moment!!?


> It indicates that make starts something even though it sees that load
> average is above 2.5!

Yes, exactly.

> I think the manual is ambiguous and some what in contradiction with
> the lines that follows. It should say:
> "make will not start new jobs till load average is 2.5 or above AND
> the number of jobs is at least one"

No, you are wrong.  Make checks the load average only _after_ it
starts the first job.  At that time, if the load average is more than
2.5 (or whatever argument you passed to -l), it will not start any
additional jobs.  If the load average is less than 2.5, it will start
another job and check the load average again.  Etc., etc.

In other words, it always starts at least one job, and possibly more.
As Sam points out, not starting any job would not be useful, because
then Make will not be able to do anything until the load average goes
below the threshold, which could be a very long time -- hardly a
useful strategy.

Invoking Make with the -l switch does not guarantee that the load
average will never rise above the given value.  It guarantees that it
will not rise too much, though.  For a single-threaded program
launched by Make, the load average should not be more than LA + 1,
where LA is the argument to -l.  In the example with -l 2.5, it will
be lower than 3.5 (again, only for single-threaded programs; it could
be higher for multi-threaded programs, or programs that launch other

reply via email to

[Prev in Thread] Current Thread [Next in Thread]