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: Whats' the proper senario of par-map? (Was Re: bug#13188: par-map causes VM stack overflow) Date: Thu, 28 Mar 2013 21:07:12 +0100 Message-ID: <87sj3fxp8v.fsf@gnu.org> References: <1355559152.27310.5.camel@Renee-desktop.suse> <87y5d8rclr.fsf@gnu.org> <1364439334.2730.41.camel@Renee-desktop.suse> <874nfwazc3.fsf@tines.lan> <87r4izprks.fsf@gnu.org> <87ip4b9zfv.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 1364501253 19292 80.91.229.3 (28 Mar 2013 20:07:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Mar 2013 20:07:33 +0000 (UTC) Cc: 13188-done@debbugs.gnu.org, guile-devel@gnu.org To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Mar 28 21:07:59 2013 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 1ULJ74-0003FJ-AT for guile-devel@m.gmane.org; Thu, 28 Mar 2013 21:07:54 +0100 Original-Received: from localhost ([::1]:41401 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULJ6g-00018K-1R for guile-devel@m.gmane.org; Thu, 28 Mar 2013 16:07:30 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULJ6b-00014X-GZ for guile-devel@gnu.org; Thu, 28 Mar 2013 16:07:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULJ6a-0002hY-83 for guile-devel@gnu.org; Thu, 28 Mar 2013 16:07:25 -0400 Original-Received: from [2a01:e0b:1:123:ca0a:a9ff:fe03:271e] (port=56883 helo=xanadu.aquilenet.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULJ6a-0002bC-1s for guile-devel@gnu.org; Thu, 28 Mar 2013 16:07:24 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by xanadu.aquilenet.fr (Postfix) with ESMTP id 6807FCDBE; Thu, 28 Mar 2013 21:07:14 +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 dzgo47yLBJg6; Thu, 28 Mar 2013 21:07:14 +0100 (CET) Original-Received: from pluto (reverse-83.fdn.fr [80.67.176.83]) by xanadu.aquilenet.fr (Postfix) with ESMTPSA id B11C4CDB6; Thu, 28 Mar 2013 21:07:13 +0100 (CET) X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 8 Germinal 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: <87ip4b9zfv.fsf@tines.lan> (Mark H. Weaver's message of "Thu, 28 Mar 2013 14:00:52 -0400") User-Agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.3 (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:16050 Archived-At: Mark H Weaver skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> Mark H Weaver skribis: >> >>> It only makes sense to use 'par-map' when the procedure is fairly >>> expensive to compute. >> >> Indeed. >> >>> There is inevitably a lot of overhead in creating and joining the >>> threads. >> >> We use a thread pool, so there=E2=80=99s no such cost. > > Sorry, I was using the term 'threads' not in the sense of OS-level > threads, but in a more general sense. I should have been more clear. > > What I meant is that from the user's perspective, threads are being > created and joined, and even if you build those using a pool of OS-level > threads, this inevitably involves thread synchronization, which is very > expensive on modern architectures. So I maintain that there _is_ such a > cost, and it can't be avoided. Ah yes, OK. > The point I was really trying to make here, in the simplest possible > terms, is that it will *never* make sense to replace all uses of 'map' > with 'par-map' wherever it is safe to do so. Indeed! Ludo=E2=80=99.