158

Avionics For aircraft control systems, we don't speak of operating systems but of avionics, integrated avionics or computer airborne systems in general. And they are actually a combination of a multitude of independent or inter-dependent systems, for different functions (flight control, collision avoidance, weather, communications, blackboxes...). Each ...


38

Fast does not mean real-time and real-time does not mean fast. Real-time means that the date when outcome is delivered is as important as its value. In other words, if the outcome has a correct value but is delivered too early or too late, then the overall result is wrong. For instance, think of a video player. If video frames are not displayed at the ...


36

There are two additional items I can remember off-hand: JIT compilation Threading implementation In term of real-time, predictability of performance is probably the most important factor; That's why an unpredictable GC cycle makes Java unsuitable for real-time. JIT offers improved performances, but kicks in at some point after the program is running, ...


33

The operating system As long as Java runs on top of Unix or Windows or any other "regular" OS, realtime is not guaranteed. A real time OS is mandatory for running realtime applications.


33

The Fowler Article providers a good primer, and this explanation: At a crude level you can think of a Disruptor as a multicast graph of queues where producers put objects on it that are sent to all the consumers for parallel consumption through separate downstream queues. When you look inside you see that this network of queues is really a single ...


28

A software is real time not when it is as fast as possible, but when it is guaranteed that a process completes within some determined time slot. In a soft real time system, it is good but not absolutely necessary that this is guaranteed. E.g. in a game, the calculations necessary for a frame should complete within the period of a frame, or the framerate will ...


22

Most modern aircraft use a general purpose RTOS (realtime operating system) pretty much the same thing that is used in factory automation, power stations, ships etc Airbus use a few, including INTEGRITY from Northrop-grumman and program it in C/C++, Boeing use VxWorks among others


15

As @mouviciel already said, real-time and fast are really two independent properties, even though many real-time deadlines imply that a relatively fast response is needed. When writing real-time software, the most important property next to a correct response is that you can accurately predict how fast the response will be given. For hard real-time features,...


14

Google Drive If you're trying to make your own version of google docs, I suggest you take a look at the Google Realtime API. Google recently released this with the intent of allowing other developers to use the same tools they did to allow for realtime collaboration. This would allow you to save time on your development and get a working product sooner. ...


12

For what it's worth: For spacecraft (satellites and interplanetary ones) C and C++ is still dominant (and with very strict compliance to ISO standards), generally running VxWorks. Labs will generally stick with either C or C++ based on developer familiarity, confidence in the compiler toolchain, and internal coding standards. There are compelling reasons for ...


11

I think it's safe to assume there is a similar "starting date" in other languages so I guess the specific implementation in Java doesn't matter. Pretty much all computers use this or a similar variation of Unix time. How is the time calculation performed by the computer? How does it know exactly how many milliseconds have passed from that given "...


11

Without an example, this question is a little bit too broad for my taste, so best answer I can give you is a very generic one. IMHO what you need is a more functional approach: model your data using immutable objects. For immutable objects, there is no need to create any copies, they can be passed by reference without the risk of creating any side effects. ...


11

Microcontroller programs consist of a number of tasks. Let's say you wanted to make a computer-controlled telescope mount. The tasks would be: Retrieve a new byte of input from the USB serial buffer. Check if we've received a complete command. If so, execute that command. Read the sensors for the current telescope position. Set the proper output to ...


10

Also worth noting that the control systems are often developed using model-based-design using Simulink. The design is then converted into C code automatically. Humans still read and validate the code.


10

Erlang processes don't share memory, each one has its own heap and they can be garbage-collected independently. Many small heaps result in many small GC-pauses, rather than few big ones.


9

From this article about CoralQueue: The disruptor pattern is a batching queue backed up by a circular array (i.e. the ring buffer) filled with pre-allocated transfer objects which uses memory-barriers to synchronize producers and consumers through sequences. So producers and consumers do not step on each other inside the circular array by checking ...


9

You can use triggers. CREATE TRIGGER notifyMe ON table1 AFTER INSERT, UPDATE, DELETE AS EXEC msdb.dbo.sp_send_dbmail @profile_name = 'DB AutoMailer', @recipients = 'user@example.com', @body = 'The DB has changed', @subject = 'DB Change'; GO


8

From user point of view, I would want to know whether whatever I am doing at given moment is going to fail as soon as possible. Which is why I suggest going for key-up validation. Few reasons for it: gives user nice real-time interaction and security feel (system is watching whether you do what you're supposed to correctly) helps user to focus at one task ...


8

For my money, holding a dependency on some clock class is the clearest way to go about handling time-dependent testing. In PHP, it may be as simple as a a class with a single function now which returns the current time using time() or new DateTime(). Injecting this dependency allows you to manipulate the time in your tests and use the real time in ...


8

I'm going to use Python-like pseudocode based around your test cases to (hopefully) help explain this answer a little, rather than just expositing. But in short: This answer is basically just an example of small, single-function-level dependency injection / dependency inversion, instead of applying the principle to an entire class/object. Right now, it ...


8

Your third idea seems to be the closest to what I think of as the industry solution to this sort of problem. What you're describing is commonly referred to as Ticks. In each tick, a fixed number of actions would be processed for each client in serial. Often times, game servers will have some parallel actions when capable, but this is a much more complicated ...


8

I suppose the two-sentence explanation of realtime is that a realtime system is designed to understand and control the worst-case response time from inputs changing to outputs changing. That requires an analysis that covers the whole system. Let's say you have a trivial system that consists of a USB keyboard and a brake servo. What responsiveness can you ...


8

Sometimes (due to noise, collisions, ...) packets get mangled and/or just plain lost (dropped due to congestion, lots due to a router going offline, etc). TCP is supposed to recover from this by retrying. The number of retries is unbounded. For a theoretical worst case (which is the only thing that matters for real time), an unbounded number of retries ...


7

Technically it's possible to have real time java (as SK-logic's comments suggest). however it is not common for a number of non-technical reasons: Old standards Having trouble finding a reference for this but I'm certain I've seen safety standards, or safety standard conformance advice, put a blanket ban on Java. Rightly or wrongly if you have to conform ...


7

The optimization that fulfills your first two bullets is called an Object Pool. It works by creating a pool of objects when the program starts, maintaining references to those objects in a list so that they don't get garbage collected, handing objects to your program from the pool as needed, and returning objects back to the pool when you're done using ...


7

I wrote my own co-operative multi-threading library for ARM Cortex-M0. It was barely a couple pages of code, and the first version of it didn't take longer than a day to write and debug. The big advantage of roll-your-own is you know the code and you can port it to chips that the RTOS might not support. Also, you spend less time thinking about questions ...


6

By not treating all Interrupt Service Routines (ISR's) as the highest priority. The kernel of an RTOS is preemptible where as a GPOS kernel is not preemptible. This is a major issue when it comes to serving high priority process/threads first. If kernel is not preemptible, then a request/call from kernel will override all other process and threads. For ...


6

Never manipulate the actual time time or speed of the system you are testing on just to test time logic. It's hard to get right and may have lots of unforeseen side effects. Instead, decouple all time-related functionality in your code base; business code will use a trivial implementation that just delegates to the normal functions, and during tests you can ...


5

There are 60 seconds in a minute, 60 minutes in an hour, and 24 hours in a day. That's 86400 seconds in a day. Multiply that by 1000, and you've got the number of milliseconds in a day. You should now be able to work out the number of days from the beginning of time (January 1, 1970, 00:00:00 GMT). Multiply that by the number of milliseconds in a day, ...


5

The problem with floating point code is that it doesn't behave like pen-and-paper decimal arithmetic calculations. This leads people who haven't taken the time to understand what is going on to make incorrect assumptions about the behavior of floating point numbers, which can then lead to incorrect program behavior. The behavior of FP calculations with very ...


Only top voted, non community-wiki answers of a minimum length are eligible