The following spins, burning about 250% cpu time, for large lists; it works
fine for smaller lists.   This is for a recent version of guile from git:

guile -v
guile (GNU Guile) 2.1.5.19-7e9395

will retry with newer guile shortly.

On fresh guile:

(use-modules (srfi srfi-1))
(define al (list-tabulate 100000 values))
(define foo 0)
(par-for-each (lambda (x) (set! foo (+ x foo))) al)

^CERROR: In procedure scm-error:
ERROR: User interrupt

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]> ,bt
In ice-9/threads.scm:
   289:22  5 (loop _)
In ice-9/futures.scm:
   265:11  4 (touch #<future 55e1984d3400 started #<procedure 55e198659f60
a…>)
   243:14  3 (work)
In unknown file:
           2 (wait-condition-variable #t)
While executing meta-command:
ERROR: In procedure cdr: Wrong type argument in position 1 (expecting
pair): ()
scheme@(guile-user) [1]>

The above is after interrupting after an hour or so of accumulated CPU
time.

Again, shorter lists (e.g. 10K long) work fine. My production lists are
about 400K to 2M in size.

--linas

Reply via email to