Date: Fri, 12 Nov 2004 09:59:51 +0100 From: "Poul-Henning Kamp" <phk@phk.freebsd.dk> Cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.bin/make job.c job.h main.c make.c Message-ID: <93962.1100249991@critter.freebsd.dk> In-Reply-To: Your message of "Fri, 12 Nov 2004 08:58:07 GMT." <200411120858.iAC8w7ng088956@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Please see: http://phk.freebsd.dk/misc/make.png It shows the loadaverage for "make -j 12 -s buildworld" with and without this code. Poul-Henning In message <200411120858.iAC8w7ng088956@repoman.freebsd.org>, Poul-Henning Kamp writes: >phk 2004-11-12 08:58:07 UTC > > FreeBSD src repository > > Modified files: > usr.bin/make job.c job.h main.c make.c > Log: > Add code to enforce the paralleism count (-j N) for the entire tree > of submakes spawned during processing. > > We create a fifo and stuff one character into it for each job we are > allowed to run. The name of the fifo is passed to child processes > in the MAKE_JOBS_FIFO environment variable. > > A make which finds this variable on startup will open the fifo and > only spawn jobs when it managed to read a token from the fifo. > When the job completes a token is writen back to the fifo. > > Slave make processes get one token for free: the one their parent > make got in order to run them. This makes the make processes > themselves invisible in the process counts. > > The net effect is that "make -j 12 -s buildworld" will start at > most 12 jobs at the same time, instead of as previously up to > 65 jobs would get started. > > Revision Changes Path > 1.57 +114 -28 src/usr.bin/make/job.c > 1.26 +1 -1 src/usr.bin/make/job.h > 1.96 +2 -0 src/usr.bin/make/main.c > 1.25 +2 -2 src/usr.bin/make/make.c > -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?93962.1100249991>