[Twisted-Python] Accurate delays in callLater

Norm Petterson njp at njp.us
Thu Jun 23 13:13:02 EDT 2005


George,

You don't say whether the cpu-intensive procedure is a part of your 
Twisted app (in which case it is an example of "blocking" behavior that 
you must design to eliminate yourself), or is running outside of Twisted 
(in which case you must utilize operating system features to run your 
Twisted app at a higher process priority).

Unlike the preemptive scheduling of real time operating systems, Twisted 
"scheduling" won't preempt anything already running.

HTH,

Norm


George Sakkis wrote:

>Hello all,
>
>I'm using twisted for a realtime simulation and I'm calling
>reactor.callLater() for scheduling actions to be performed after a fixed
>short delay (~60msec). However, if there is a cpu-intensive procedure
>running in the meantime, the timer for the scheduled call may expire much
>later, an order of magnitude or more if the procedure takes too much time.
>Is this to be expected in general ? If not, does this may have to with the
>delay being too short or the cpu-intensive procedure being mainly run in
>an extension module ? Finally, is there a way to force the required delay
>(with a tolerance of a few msec) ?
>
>Thanks for any insight,
>
>George
>
>_______________________________________________
>Twisted-Python mailing list
>Twisted-Python at twistedmatrix.com
>http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
>  
>




More information about the Twisted-Python mailing list