A Simple Multicore Example

To transform a single core application like this:

    from Kamaelia.Chassis.Pipeline import Pipeline
from Kamaelia.Util.Console import ConsoleEchoer
from Kamaelia.UI.Pygame.Text import Textbox, TextDisplayer

Pipeline(
Textbox(size = (800, 300), position = (0,0)),
TextDisplayer(size = (800, 300), position = (0,340))
).run()

Into a multicore application, you do this:

    from Axon.experimental.Process import ProcessPipeline
from Kamaelia.Chassis.Pipeline import Pipeline
from Kamaelia.Util.Console import ConsoleEchoer
from Kamaelia.UI.Pygame.Text import Textbox, TextDisplayer

ProcessPipeline(
Textbox(size = (800, 300), position = (0,0)),
TextDisplayer(size = (800, 300), position = (0,340))
).run()
And that's pretty much it. A very visual difference between these two examples is that the first of these will use just one Pygame window, and the latter will use two.

 

Kamaelia is an open source project originated from and guided by BBC Research. For more information browse the site or get in contact.

This is an ongoing community based development site. As a result the contents of this page is the opinions of the contributors of the pages involved not the organisations involved. Specificially, this page may contain personal views which are not the views of the BBC. (the site is powered by a wiki engine)

(C) Copyright 2008 Kamaelia Contributors, including the British Broadcasting Corporation, All Rights Reserved

This web site is powered by the same code created for the bicker manor project. For more details, contact Michael Sparks at BBC Research directly (cf contact)