A person can have a pacemaker due to heart disease, well, although it is relatively simple material, it still has to give a response within a certain time. If we are already moving around in the driving environment, we can find a microcontroller responsible for making sure that the whole system is working at the ideal times to avoid a mechanical or electrical failure in the vehicle.
If we are already talking about things to be more at home, the clearest example is in the communication between two devices, which must be carried out at certain times that the standard sets. This especially occurs in wireless printers which send out bursts of data when printing to paper. Also, let’s not forget the 8- and 16-bit consoles which, due to video memory limitations, had to send data to the video output when the electron beam passed through the screen.
What is real-time computing?
Real-time computation is understood to mean anything in which the execution of instructions or sets of instructions, of processes or of programs, must be carried out in the shortest possible time, causing fatal results if the process is not executed within said established limit. temporary. For this we need to quantify said period using a measure, which can be a standard objective time such as microseconds, milliseconds or seconds, or if we cannot do it that way, we will have to use the clock cycles of the processor which executes said instruction or set of instructions.
Thus, a real-time system must give a response within a given time from a user action regardless of the processes that existed before. A very clear example of this is when we press a button on our mouse or a command button in a video game, we expect the on-screen response to appear as quickly as possible, if it takes too long. , we understand that the system is not working. work properly.
Thus, real-time computing systems are those sensitive to the execution time of the processes and where their operation can be totally or partially affected by the non-resolution of the processes in a certain time.
Real-time calculation categories
As real-time computing has time requirements, these can be divided into two types, hard and software.
- In a hard-type real-time system, if the process does not run within the specified time, a complete system failure results. For example, a car’s real-time airbag system may not work in time, and the accident victim hits the steering wheel and dies instantly.
- On the other hand, a real-time system of the soft type only suffers a loss of quality of service, but not a general failure of the system, a clear example is the Input Lag in a video game or the delay in a broadcast.
We usually see the first type in devices that operate on a stand-alone and continuous loop basis, where adding any additional instructions can cause a delay in the process which can be fatal, which is why microcontrollers are used for this which work in a similar fashion. In isolation and with each of its instructions measured for a performance worthy of a Swiss watch. Are they on our PCs? Well yes, for example systems that control the Boost periods of the CPU and GPU are examples of real-time computing systems
The reason that microcontrollers are used is because their RAM memory is inside the processor itself, so its latency is minimal and a cache system is not needed, moreover, it would be totally against -productive, because in these cases it would add latency and be fatal to the proper functioning of the system. In microcontrollers, the instruction set is not only given the meaning of what each of them does, but also of the time they consume.
Use of special operating systems in real time
However, the problem with a microcontroller is that it is not able to run more than one process at the same time and this is when it is necessary to use more hardware and software. complex, especially the latter and so it is there that they real-time operating systems that are responsible for managing the processes that will run on the processor, again we have two types:
- Event-driven systems, programs run in the normal way, but events do not have an execution preference for a privilege and hierarchy system originally, but these are resolved as they go. and as they appear.
- A time-sharing system, in which each instruction is given an execution time to avoid delays, if a process cannot be executed in the expected time, it is paused and skipped to the next process.
These types of operating systems run on much more advanced microcontrollers, with cores capable of running multiple processes at the same time and therefore can perform much more complex tasks or a succession of them in an orderly fashion that together require more power for their operation. When it comes to categorizing real-time operating systems or RTOS, these are categorized based on what type of real-time computation you want to use, so there are both hardware and software types.