ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
What is the context of your question?
What kind of real-time system?
Not a homework its just something I need to discuss in the next lecture. I mean real-time systems in general, ex: anti-burglar system. My question is why the object oriented languages are not better choice for implementing such systems since for the time constraint is important. I'm not very familiar with this thats why I ask, but I have some basic ideas, all I need is a little nudge
Discuss in the lecture??? Are you the teacher? (If you are a student, then preparing for a class discussion IS homework.)
What is your background in programming? Have you ever programmed a real-time system?
I am not well-versed in object-oriented programming, but I can't think why it would make a difference. Isn't the main issue knowing how long different processes will take and/or having the time be consistent?
A real-time system is one where software, and its associated control system, has to respond to a real-world situation where 'time' is critical in the proper sense of the word. One example is where a tool in a machine-tool system (operating at full speed) is cutting a circle which has to be accurate to one-tenth of a thousandth of an inch. I've done that. Realise that not only the tool but the electronics, and the drive systems in the machine tool, have to respond to software which, itself, is highly complex. In fact, any system such as aircraft and the like, have the tiniest margin of error, else it is disaster. I suggest that a burglar system is not in that category!
I should have added in my previous post that, in my view, object oriented (OO) programming is entirely suitable for a burglar alarm system because the time constraints are not as critical as in fast real-time control software/electronic systems. The objects in OO programs are generalised but seldom for speed. I suppose one could have real-time objects, but I would prefer to write real-time software in assembler, or possibly C, even C++ with care, Ada, and I used Pascal many years ago.
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088
Rep:
There is no reason OO languages can not be used in a real-time context.
Most real-time applications are done in C, with assembly optimizations, but it could also be done in C++, or even Java. The important thing in real-time operating systems is the ability to determine how long something will take - not necessarily raw speed. As long as the language has a good compiler, and allows the programmer to determine how long each task will take, it can be used for a real-time application.
Having said that, C is generally used because it allows for optimizations, and can be very predictable. Also, most of the benefits of OO would not be required in a real-time environment.
If you need to prepare for a lecture, read the relevant chapters of your text, other texts and resources available on the internet (Like IEEE Xplore).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.