unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* problem with futures?
@ 2005-12-21 22:10 Andy Wingo
  2005-12-22  9:56 ` Mikael Djurfeldt
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Wingo @ 2005-12-21 22:10 UTC (permalink / raw)


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/



_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-01-29 18:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-21 22:10 problem with futures? Andy Wingo
2005-12-22  9:56 ` Mikael Djurfeldt
2006-01-29 18:44   ` Marius Vollmer

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).