From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:52875) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hABfb-0003Dt-MD for guix-patches@gnu.org; Sat, 30 Mar 2019 06:57:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hABfa-0004Pi-Rw for guix-patches@gnu.org; Sat, 30 Mar 2019 06:57:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50979) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hABfa-0004PV-4N for guix-patches@gnu.org; Sat, 30 Mar 2019 06:57:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hABfZ-00043m-PX for guix-patches@gnu.org; Sat, 30 Mar 2019 06:57:01 -0400 Subject: [bug#34982] [PATCH] guile-build-system: Support building in parallel. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20190324212345.4697-1-mail@cbaines.net> Date: Sat, 30 Mar 2019 11:56:33 +0100 In-Reply-To: <20190324212345.4697-1-mail@cbaines.net> (Christopher Baines's message of "Sun, 24 Mar 2019 21:23:45 +0000") Message-ID: <87lg0w4om6.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Christopher Baines Cc: 34982@debbugs.gnu.org Hi, Christopher Baines skribis: > * guix/build/guile-build-system.scm (build): Use n-par-for-each, instead = of > for-each, to use multiple cores if available. [...] > + (n-par-for-each > + (parallel-job-count) > + (lambda (file) > + (catch #t > + (lambda () > + (let* ((go (string-append go-dir > + (file-sans-extension file) > + ".go"))) > + ;; Install source module. > + (install-file (string-append source-directory "/" file) > + (string-append module-dir > + "/" (dirname file))) >=20=20 > - ;; Install and compile module. > - (apply invoke guild "compile" "-L" source-directory It probably doesn=E2=80=99t matter that much, but it feels wrong to create threads that do nothing but call =E2=80=98waitpid=E2=80=99, essentially. Commit f07041f7d25badb7d74b8fad6ee446a12af04f63 removed a =E2=80=98p-for-ea= ch=E2=80=99 procedure that could be useful here since it directly creates N processes and then does (waitpid WAITPID_ANY). Would it make sense to paste it here and use it in lieu of =E2=80=98n-par-for-each=E2=80=99? Thanks, Ludo=E2=80=99.