comp.lang.ada
 help / color / mirror / Atom feed
From: Hadrien Grasland <hadrien.grasland@gmail.com>
Subject: Re: Hint to Ada newbies
Date: Sat, 11 Feb 2017 01:25:42 -0800 (PST)
Date: 2017-02-11T01:25:42-08:00	[thread overview]
Message-ID: <14f89b0b-0a84-4b0a-b4a5-484679d1c7ca@googlegroups.com> (raw)
In-Reply-To: <lyy3xefjx7.fsf@pushface.org>

Le vendredi 10 février 2017 10:56:53 UTC+1, Simon Wright a écrit :
> Robert A Duff writes:
> 
> > Simon Wright writes:
> >
> >> I have had to use the power switch to stop a build using -j0! '-j<1 less
> >> than the number of cores>' does pretty well.
> >
> > Which operating system?
> 
> macOS (actually a few releases ago, Mavericks maybe). And it's just
> possible it was the equivalent switch in Make.

There's actually a major difference between gnatmake's -j0 and make's -j switches.

gnatmake -j0 means "Try to keep all my CPU cores busy", i.e. use 4 processes on a 4-core machine. This is reasonable, as long as you have enough RAM to handle it.

make -j means "Spawn new processes as soon as you can", i.e. use an unbounded amount of processes. Not only is this strategy stupid (your build will actually run slower if too many processes compete for system resources), it is also the easiest way to get your machine to run out of memory.

make -l ("Do not spawn new processes if the CPU load is higher than x") was an attempt to address this broken design, which fails because it cannot handle the system load inertia: stating a new process may only increase the CPU load a couple of seconds later, and this is enough for make to spawn tons of build processes in meantime.


  reply	other threads:[~2017-02-11  9:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-09  4:17 Hint to Ada newbies reinkor
2017-02-09  6:06 ` Per Sandberg
2017-02-09  8:02   ` Simon Wright
2017-02-09 23:12     ` Robert A Duff
2017-02-10  9:22       ` Dmitry A. Kazakov
2017-02-11  9:16         ` Hadrien Grasland
2017-02-11  9:39           ` Dmitry A. Kazakov
2017-02-10  9:56       ` Simon Wright
2017-02-11  9:25         ` Hadrien Grasland [this message]
2017-02-09  9:26   ` reinkor
2017-02-09 17:40   ` John Smith
2017-02-11 17:40 ` stevenselectronicmail
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox