[Twisted-Python] Accurate delays in callLater
Norm Petterson
njp at njp.us
Thu Jun 23 14:27:20 EDT 2005
Sébastien Pierre wrote:
> Hi !
>
> Le 23 juin 05 à 19:30, Bob Ippolito a écrit :
>
>> Additionally, the precision of reactor.callLater is only as good as
>> the precision of the reactor's primitive for timing (select, in the
>> default reactor). The precision of select varies widely based on
>> the platform.
>>
>> You might have more luck with twisted.internet.task.LoopingCall
>
>
> This makes me want to ask if Twisted is able to run "smooth real
> time" processes. Say for instance that I have to run a process every
> second (with a precision of 0.1s). Can I be sure that after having
> run for 1 hours the process will have been executed 3600 times ? same
> for 1 day, 1 week, etc ?
>
Based on
http://twistedmatrix.com/pipermail/twisted-python/2004-March/007254.html,
I've been using twisted.internet.task.LoopingCall for applications
calling for 1 second (or 2 second, or 10 second, etc.) indefinite
repetition for the past year, and have noted minor slippage that I
attribute to *not* bumping the twisted application process priority
above its default on the platforms involved (Linux/DEC Alpha, W2K/Intel
P4). If the slippage were unacceptable, I'd try raising process priority
before anything else...
Norm
More information about the Twisted-Python
mailing list