Priority based concurrent execution

Willi Richert w.richert at
Thu Sep 21 12:16:12 CEST 2006


I have a simulation application (PlayerStage) in which the robot is asked 
every ~200ms for an action. In the meantime the robot has to do some 
calculation with the perception. As the calculation gets more and more time 
consuming I am thinking about outsourcing it into a concurrently running 
method. If the calculation takes too long it would be ok for the result to be 
incorporated in some future cycle of the main loop, resulting in the 
calculation being done less and less often and the main loop executing some 
stop behavior.
My question: Is there a possibility in Python (either with the threading 
module or with Twisted's non-threading style) to prioritize the two 
(pseudo-)concurrent methods so that the main tread is further on executed 
every ~200ms and the calculation thread being executed only in "idle" time 


More information about the Python-list mailing list