473,385 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 3614
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: | last post by:
I've trolled the lists, FAQs, and Net as a whole, but can't find anything definitive to answer this. We're looking for real-time graph capability (bar, line, etc), so that we can display...
9
by: Hans-Joachim Widmaier | last post by:
Hi all. Handling files is an extremely frequent task in programming, so most programming languages have an abstraction of the basic files offered by the underlying operating system. This is...
2
by: Alberto Santini | last post by:
I ported a Jos Stam's demo about Fluid mech to check the difference of speed between C implementation and Python. I think I achieved good results with Python and there is space to improve, without...
30
by: Raymond Hettinger | last post by:
Proposal -------- I am gathering data to evaluate a request for an alternate version of itertools.izip() with a None fill-in feature like that for the built-in map() function: >>> map(None,...
1
by: frikk | last post by:
Hey Everyone! I've got a question regarding the capabilities of python in a real time environment. I'll start by saying I'm a little bit flaky when it comes to terminology, so please correct me or...
0
by: Johannes Nix | last post by:
Hi, this might be of interest for people who are look for practical information on doing real-time signal processing, possibly using multiple CPUs, and wonder whether it's possible to use...
2
by: Blubaugh, David A. | last post by:
To All, 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...
0
by: Hendrik van Rooyen | last post by:
"Blubaugh, David A." <dblub....elcan.comwrote: I am running some i/o in a thing called an eBox running Slackware Linux for which GPIO port we have made some I/O boards. This is a very weak...
0
by: Kurt Mueller | last post by:
Am 08.10.2008 um 06:59 schrieb Hendrik van Rooyen: OK, this is gives an impression of SPEED. In your application the REAL-TIME requirements are isolated and implemented in the custom...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.