High resolution sleep (Linux)

John Nagle nagle at animats.com
Tue May 8 21:23:50 EDT 2007


Hendrik van Rooyen wrote:
>  "Tim Roberts" <ti.. at pr...o.com> wrote"

> It is also possible to keep the timer list sorted by "expiry date",
> and to reprogram the timer to interrupt at the next expiry time
> to give arbitrary resolution, instead of implementing a regular 'tick'.

     Yes, and that's a common feature in real-time operating systems.
If you're running QNX, you can expect that if your high priority
task delays to a given time, you WILL get control back within a
millisecond of the scheduled time.   Even tighter timing control
is available on some non-x86 processors.

     Some CPUs even have hardware support for a sorted event list.
The Intel 8061, which ran the engines of most Ford cars in the 1980s,
had that.

     But no way are you going to get consistent timing resolution like that
from Python.  It's an interpreter with a garbage collector, after all.

				John Nagle



More information about the Python-list mailing list