First process based component. Thanks to Paul Boddie's library for forking python interpreters. This makes this component the first *truly* parallel component, since on a machine with multiple CPUs it would indeed function in parallel:
First process based component. Thanks to Paul Boddie's library for
forking python interpreters. This makes this component the first *truly*
parallel component, since on a machine with multiple CPUs it would
indeed function in parallel:

class FirstProcessBasedComponent(SimplestProcessComponent):
    def main(self):
        while 1:
            yield 1
            time.sleep(0.3)
            if self.dataReady():
                print time.time(),"main : RECEIVE FROM CHANNEL", self.recv()
            else:
                print time.time(),"main: CHANNEL NOT READY"

You'll note it's code compatible with single threaded components, just
with a different base class.



Michael.

sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia