469,579 Members | 1,899 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,579 developers. It's quick & easy.

Re: HARD REAL TIME PYTHON

David,
Am 07.10.2008 um 01:25 schrieb Blubaugh, David A.:
I have done some additional research into the possibility of utilizing
Python for hard real time development. I have seen on various
websites
where this has been discussed before on the internet. However, I was
wondering as to how successful anyone has truly been in developing a
program project either in windows or in Linux that was or extremely
close to real time constraints? For example is it possible to
develop a
python program that can address an interrupt or execute an operation
within 70 Hz or less?? Are there any additional considerations that I
should investigate first regarding this matter??

As others mentioned before, python is not the right tool for "HARD
REAL TIME".

But: Maybe you can isolate the part of your application that needs
"HARD REAL TIME".
Then implement this part in an approriate Environment (Language,
OS, HW).
Then implement the rest of your application which is not "HARD
REAL TIME"
in python.

To be more helpful, we should know what you mean by "HARD REAL TIME".
Do you mean:
- Handle at least 70 interrupt per second ("SPEED")
- If one fails, this is catastrophic for the application ("HARD")
- Deliver an response to an interrupt within 5-10[ms] ("REAL
TIME")

see http://en.wikipedia.org/wiki/Real-time
Grüessli
--
Kurt Müller, mu@problemlos.ch

Oct 7 '08 #1
3 3161
Kurt Mueller wrote:
David,
Am 07.10.2008 um 01:25 schrieb Blubaugh, David A.:
>I have done some additional research into the possibility of utilizing
Python for hard real time development. I have seen on various
websites
where this has been discussed before on the internet. However, I was
wondering as to how successful anyone has truly been in developing a
program project either in windows or in Linux that was or extremely
close to real time constraints? For example is it possible to
develop a
python program that can address an interrupt or execute an operation
within 70 Hz or less?? Are there any additional considerations that I
should investigate first regarding this matter??


As others mentioned before, python is not the right tool for "HARD
REAL TIME".

But: Maybe you can isolate the part of your application that needs
"HARD REAL TIME".
Then implement this part in an approriate Environment (Language,
OS, HW).
Then implement the rest of your application which is not "HARD
REAL TIME"
in python.

To be more helpful, we should know what you mean by "HARD REAL TIME".
Do you mean:
- Handle at least 70 interrupt per second ("SPEED")
- If one fails, this is catastrophic for the application ("HARD")
- Deliver an response to an interrupt within 5-10[ms] ("REAL
TIME")

see http://en.wikipedia.org/wiki/Real-time
I've done this using RTAI + ctypes. Of course the hard realtime tasks are
written in C - but only the absolutely minimal core.

Works like a charm.

Diez
Oct 7 '08 #2
Am 07.10.2008 um 11:44 schrieb Diez B. Roggisch:
Kurt Mueller wrote:
>David,
As others mentioned before, python is not the right tool for "HARD
REAL TIME".
But: Maybe you can isolate the part of your application that needs
"HARD REAL TIME".
Then implement this part in an approriate Environment (Language,
OS, HW).
Then implement the rest of your application which is not "HARD
REAL TIME"
in python.
I've done this using RTAI + ctypes. Of course the hard realtime
tasks are
written in C - but only the absolutely minimal core.
Works like a charm.
(Btw, what is this application like)
Yes.
The key is to
!*isolate*!
the part of the application that needs "HARD REAL TIME".
Thats what you have done with the "absolutely minimal core"
in RTAI + ctypes.

Sometimes it is even questionable if an application really
needs "HARD REAL TIME".
sometimes it is enough to have "soft real time" or even
"fast enough" is enough.

Good enough is good enough!

"HARD REAL TIME" is mostly expensive.

Grüessli
--
Kurt Müller, mu@problemlos.ch

Oct 7 '08 #3
>I've done this using RTAI + ctypes. Of course the hard realtime
>tasks are
written in C - but only the absolutely minimal core.
Works like a charm.

(Btw, what is this application like)
It's for a robot with 8 motors, with a industrial PIII-based PC on board,
running RTAI Linux 2.6. The core control task is user-space realtime with a
1ms loop and gets it's controlling commands via plain C-structs that I pass
in using python/ctypes.

On of the great things about this is that there is Python's GC working in
favor of me, as I can simple allocate/deallocate data structures from
withing Python.

Diez
Oct 7 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by | last post: by
9 posts views Thread by Hans-Joachim Widmaier | last post: by
2 posts views Thread by Alberto Santini | last post: by
30 posts views Thread by Raymond Hettinger | last post: by
1 post views Thread by frikk | last post: by
2 posts views Thread by Blubaugh, David A. | last post: by
reply views Thread by Hendrik van Rooyen | last post: by
reply views Thread by Kurt Mueller | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.