From owner-cvs-src@FreeBSD.ORG Sun Nov 14 15:42:18 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B5D9116A4CE; Sun, 14 Nov 2004 15:42:18 +0000 (GMT) Received: from web.portaone.com (mail.russia.cz [195.70.151.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id EC0D143D53; Sun, 14 Nov 2004 15:42:17 +0000 (GMT) (envelope-from sobomax@portaone.com) Received: from [192.168.1.100] (xDSL-2-2.united.net.ua [193.111.9.226]) (authenticated bits=0) by web.portaone.com (8.12.11/8.12.11) with ESMTP id iAEFgBNA037415 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 14 Nov 2004 16:42:14 +0100 (CET) (envelope-from sobomax@portaone.com) Message-ID: <41977CCC.8070607@portaone.com> Date: Sun, 14 Nov 2004 17:42:04 +0200 From: Maxim Sobolev Organization: Porta Software Ltd User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Poul-Henning Kamp References: <200411120858.iAC8w7ng088956@repoman.freebsd.org> In-Reply-To: <200411120858.iAC8w7ng088956@repoman.freebsd.org> Content-Type: text/plain; charset=KOI8-U; format=flowed Content-Transfer-Encoding: 7bit cc: cvs-src@FreeBSD.ORG cc: src-committers@FreeBSD.ORG cc: cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/usr.bin/make job.c job.h main.c make.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Nov 2004 15:42:18 -0000 Great job! However I wonder if use of pipe(2) would be better way, which will not leave any traces behind it in the case when all makes die in a way that prevents them from taking clean up actions (e.g. kill -9). -Maxim Poul-Henning Kamp wrote: > 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 > > >