viff

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 diff
     1.1 --- a/viff/runtime.py	Mon Sep 28 18:36:21 2009 +0200
     1.2 +++ b/viff/runtime.py	Tue Sep 29 12:57:20 2009 +0200
     1.3 @@ -767,16 +767,22 @@
     1.4          wait_list = []
     1.5          for ((generator, args), program_counters) in program.iteritems():
     1.6              print "Preprocessing %s (%d items)" % (generator, len(program_counters))
     1.7 +            self.increment_pc()
     1.8 +            self.fork_pc()
     1.9              func = getattr(self, generator)
    1.10              results = []
    1.11              items = 0
    1.12              while items < len(program_counters):
    1.13 +                self.increment_pc()
    1.14 +                self.fork_pc()
    1.15                  item_count, result = func(*args)
    1.16                  items += item_count
    1.17                  results.append(result)
    1.18 +                self.unfork_pc()
    1.19              ready = gatherResults(results)
    1.20              ready.addCallback(update, program_counters)
    1.21              wait_list.append(ready)
    1.22 +            self.unfork_pc()
    1.23          return DeferredList(wait_list)
    1.24  
    1.25      def input(self, inputters, field, number=None):