unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: Amirouche Boubekki <amirouche@hypermove.net>
Cc: Guile Devel <guile-devel@gnu.org>
Subject: Re: (n-for-each-par-map 16 store download (reverse (iota (max-id))))) crash
Date: Fri, 06 Jul 2018 03:01:21 -0400	[thread overview]
Message-ID: <87k1q8j1a6.fsf@netris.org> (raw)
In-Reply-To: <b49432e369e74374c624b66514b6e1bc@hypermove.net> (Amirouche Boubekki's message of "Fri, 06 Jul 2018 07:55:09 +0200")

Hi,

Amirouche Boubekki <amirouche@hypermove.net> writes:

> On 2018-07-05 20:30, Mark H Weaver wrote:
>> Amirouche Boubekki <amirouche@hypermove.net> 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



      reply	other threads:[~2018-07-06  7:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-05 11:28 (n-for-each-par-map 16 store download (reverse (iota (max-id))))) crash Amirouche Boubekki
2018-07-05 18:30 ` Mark H Weaver
2018-07-06  5:55   ` Amirouche Boubekki
2018-07-06  7:01     ` Mark H Weaver [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k1q8j1a6.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=amirouche@hypermove.net \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).