From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.devel Subject: Re: (n-for-each-par-map 16 store download (reverse (iota (max-id))))) crash Date: Fri, 06 Jul 2018 03:01:21 -0400 Message-ID: <87k1q8j1a6.fsf@netris.org> References: <567d1b31558c2b51908d8a272ff61494@hypermove.net> <871schk01n.fsf@netris.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1530860450 9110 195.159.176.226 (6 Jul 2018 07:00:50 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 6 Jul 2018 07:00:50 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: Guile Devel To: Amirouche Boubekki Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Jul 06 09:00:46 2018 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbKjW-0002Hj-0N for guile-devel@m.gmane.org; Fri, 06 Jul 2018 09:00:46 +0200 Original-Received: from localhost ([::1]:56097 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbKld-00028f-39 for guile-devel@m.gmane.org; Fri, 06 Jul 2018 03:02:57 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbKlW-00028K-Rd for guile-devel@gnu.org; Fri, 06 Jul 2018 03:02:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fbKlT-0004cN-Ey for guile-devel@gnu.org; Fri, 06 Jul 2018 03:02:50 -0400 Original-Received: from world.peace.net ([64.112.178.59]:32950) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fbKlT-00041o-Ao for guile-devel@gnu.org; Fri, 06 Jul 2018 03:02:47 -0400 Original-Received: from mhw by world.peace.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fbKlI-0001Fs-4P; Fri, 06 Jul 2018 03:02:36 -0400 In-Reply-To: (Amirouche Boubekki's message of "Fri, 06 Jul 2018 07:55:09 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.112.178.59 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.lisp.guile.devel:19588 Archived-At: Hi, Amirouche Boubekki writes: > On 2018-07-05 20:30, Mark H Weaver wrote: >> Amirouche Boubekki writes: >> >>> (define (store pair) >>> (if (null? pair) >>> (format #t "X\n") >>> (let ((port (open-file "hn.scm" "a"))) >>> (format #t "~a\n" (car pair)) >> >> These calls to (format #t ...), which write to a port that is shared by >> multiple threads, should be performed while holding a mutex to prevent >> concurrent writes to the same port. > > Ok, but it's called by: > > (n-for-each-par-map n sproc pproc lst1 lst2) > > and the manual says about SPROC that : > > The sproc calls are made serially, > in list element order, one at a time. > > In my case SPROC is 'store', so my understanding is that > it should require no lock. You're right, my mistake. I'm not sure what's going on here. It would be good to send a message to bug-guile@gnu.org to file a bug report, and to continue the discussion there. Thanks! Mark