guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

problem with futures?


From: Andy Wingo
Subject: problem with futures?
Date: Wed, 21 Dec 2005 17:10:13 -0500

Hi,

With current CVS on PPC (because I still haven't investigated enough to
figure what's wrong on x86-64),

(define (nsum n)
  (apply + (let ((x 1))
             (par-map (lambda (y) (set! x (1+ x)) (+ y x))
                      (make-list n 0)))))

I get this:

guile> (nsum 100)
$1 = 5150
guile> (nsum 100)
$2 = 5150
guile> (nsum 100)
$3 = 5150
guile> (nsum 100)

Backtrace:
In current input:
   5: 0* [nsum 100]
   1: 1  [apply #<primitive-generic +> ...
   1: 2*  (let* ((x 1)) (par-map (lambda (y) (set! x #) (+ y x))
(make-list n 0)))
   1: 3   [par-map #<procedure #f (y)> (0 0 0 0 0 0 0 0 0 ...)]
In /opt/guile/share/guile/1.7/ice-9/threads.scm:
  52: 4   [map #<primitive-procedure future-ref> ...
  53: 5*   [apply #<primitive-generic map> #<procedure #f args> ...]
In unknown file:
   ?: 6    [map]
   ?: 7*   [map #<procedure #f args> (0 0 0 0 0 0 0 0 0 ...)]
   ?: 8*   [#<procedure #f args> 0]
In /opt/guile/share/guile/1.7/ice-9/threads.scm:
  55: 9*   (future (apply mapper (proc . arglists)))

/opt/guile/share/guile/1.7/ice-9/threads.scm:55:20: In expression
(future (apply mapper #)):
/opt/guile/share/guile/1.7/ice-9/threads.scm:55:20: Cannot allocate
memory

>From then on out I can't call nsum any more. Perhaps threads assigned to
futures are not being gc'd properly.

Regards,
-- 
Andy Wingo
http://wingolog.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]