Hi, Amirouche Boubekki <amirou...@hypermove.net> writes:
> On 2018-07-05 20:30, Mark H Weaver wrote: >> Amirouche Boubekki <amirou...@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-gu...@gnu.org to file a bug report, and to continue the discussion there. Thanks! Mark