changeset 1256:3e1043e38221

Fork program counter for every preprocessing operation und generator call.
author Marcel Keller <mkeller@cs.au.dk>
date Tue, 29 Sep 2009 12:57:20 +0200
parents 8063a78b8ef5
children 1754fd1e0d9f
files viff/runtime.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/viff/runtime.py	Mon Sep 28 18:36:21 2009 +0200
+++ b/viff/runtime.py	Tue Sep 29 12:57:20 2009 +0200
@@ -767,16 +767,22 @@
         wait_list = []
         for ((generator, args), program_counters) in program.iteritems():
             print "Preprocessing %s (%d items)" % (generator, len(program_counters))
+            self.increment_pc()
+            self.fork_pc()
             func = getattr(self, generator)
             results = []
             items = 0
             while items < len(program_counters):
+                self.increment_pc()
+                self.fork_pc()
                 item_count, result = func(*args)
                 items += item_count
                 results.append(result)
+                self.unfork_pc()
             ready = gatherResults(results)
             ready.addCallback(update, program_counters)
             wait_list.append(ready)
+            self.unfork_pc()
         return DeferredList(wait_list)
 
     def input(self, inputters, field, number=None):