From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] Futures: Avoid creating the worker pool more than once Date: Sat, 10 Nov 2012 14:53:48 +0100 Message-ID: <87y5i936oj.fsf@gnu.org> References: <87a9uu9vpk.fsf@tines.lan> <87zk2rc3kz.fsf@gnu.org> <87ehk2rvyp.fsf@tines.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1352555652 13241 80.91.229.3 (10 Nov 2012 13:54:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 10 Nov 2012 13:54:12 +0000 (UTC) Cc: guile-devel@gnu.org To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Nov 10 14:54:22 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TXBVt-0003Dh-7P for guile-devel@m.gmane.org; Sat, 10 Nov 2012 14:54:21 +0100 Original-Received: from localhost ([::1]:35022 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXBVk-0005Zt-01 for guile-devel@m.gmane.org; Sat, 10 Nov 2012 08:54:12 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:42903) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXBVf-0005Zi-6R for guile-devel@gnu.org; Sat, 10 Nov 2012 08:54:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TXBVc-0002Ey-3C for guile-devel@gnu.org; Sat, 10 Nov 2012 08:54:07 -0500 Original-Received: from [2a01:e0b:1:123:ca0a:a9ff:fe03:271e] (port=47975 helo=xanadu.aquilenet.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXBVb-00020D-Sm for guile-devel@gnu.org; Sat, 10 Nov 2012 08:54:03 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by xanadu.aquilenet.fr (Postfix) with ESMTP id 02098A912; Sat, 10 Nov 2012 14:53:52 +0100 (CET) Original-Received: from xanadu.aquilenet.fr ([127.0.0.1]) by localhost (xanadu.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sbEW96IQtDP1; Sat, 10 Nov 2012 14:53:51 +0100 (CET) Original-Received: from pluto (reverse-83.fdn.fr [80.67.176.83]) by xanadu.aquilenet.fr (Postfix) with ESMTPSA id 81837A72F; Sat, 10 Nov 2012 14:53:51 +0100 (CET) X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 20 Brumaire an 221 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu In-Reply-To: <87ehk2rvyp.fsf@tines.lan> (Mark H. Weaver's message of "Fri, 09 Nov 2012 22:13:50 -0500") User-Agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2a01:e0b:1:123:ca0a:a9ff:fe03:271e X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:15135 Archived-At: Mark H Weaver skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> Mark H Weaver skribis: >> >>> + ;; setting 'create-workers!' to a no-op is an optimization, but it is >>> + ;; still possible for '%create-workers!' to be called more than once >>> + ;; from different threads. Therefore, to avoid creating %workers mo= re >>> + ;; than once (and thus creating too many threads), we check to make >>> + ;; sure %workers is empty within the critical section. >> >> Do you have a scenario where this happens? > > I'd hoped that the comment above was clear, but let me try again. Yes, what wasn=E2=80=99t clear to me is how practical this is, and whether somebody encountered that situation in real life. Anyway, please apply. Thanks, Ludo=E2=80=99.