Python and real-time OS timing/task communication?

seletz stefan.eletzhofer at googlemail.com
Fri Jul 28 17:07:19 EDT 2006


Hi,

Ray Schumacher wrote:
> Has anyone used Python and a hard real-time OS/patch to schedule timed events?
> We have started in on Debian and RTAI, and may be using LXRT.
> (I've been reading http://people.mech.kuleuven.be/~psoetens/lxrt/portingtolxrt.html)

you should really also try http://www.xenomai.org; IMHO it has a much
cleaner API than
RTAI. And it even works for PPC targets, if thats of interst to you
(both 2.4 and 2.6 kernels).

Userspace RT programming works like a charm.

> I was envisioning that we really only need a separate RT-process in C using RDTSC or ACPI clocking that can get its control messages from non-RT Python every 50ms or so, to toggle pins on parport0.
> Any pointers, examples, etc for communicating from Python to an RT task?

Xenomai has lots of communication primitives -- I even can imagine a
simple c-coded python extension to communicate over rt queues.

Xenomai also has a "posix RT" skin, which tries to provide all of the
POSIX RT extensions, maybe even a recompile of python and linking
against the posix rt skin of xenomai would be enough.

HTH,
Stefan.
> 
> Thanks,
> Ray




More information about the Python-list mailing list