futures: Have workers work when futures are available.
authorLudovic Courtès <ludo@gnu.org>
Sat, 3 Nov 2012 00:05:19 +0000 (01:05 +0100)
committerLudovic Courtès <ludo@gnu.org>
Sat, 3 Nov 2012 00:05:19 +0000 (01:05 +0100)
commit134c95f1e6a574d30881cf3ccaffba5e3c39cca4
tree0cad19109e663cdf8e30d67ef2609c6b1b796b0d
parent1d4e6ee3013b2c0bebf7d715318e6c493f41ee19
futures: Have workers work when futures are available.

Reported by David Pirotte.

* module/ice-9/futures.scm (process-futures): Wait on %FUTURES-AVAILABLE
  only when %FUTURES is empty.

  The problem was obvious when running (begin (use-modules (ice-9
  threads)) (par-map 1+ (iota 400000))) : eventually, only the main
  thread would do the work, while the others would remain idle, waiting
  on %FUTURES-AVAILABLE.
module/ice-9/futures.scm