Hello, Friends of Hive, it is a pleasure to be with you again to continue the series on Real-time Systems.
Hola Amigos de Hive un gusto estar nuevamente con ustedes dando continuidad a la serie referente a los Sistemas de Tiempo Real.
This is the second installment and I will formally introduce the concept of Real-Time Task, its characteristics, and realization in a Real-Time System (RTS).
Esta es la segunda entrega y presentaré formalmente el concepto de Tarea de Tiempo Real, sus características y realización en un Sistema de Tiempo Real (STR).
What is a Real-Time Task?
¿Qué es una Tarea de Tiempo Real?
The ability of the RTS to provide responses meeting the temporal constraints depends on the real-time software, assuming that the system designers have chosen the right hardware for processing (Butazzo, 2011; Shirvaikar and Elbert, 2018).
La capacidad que tienen los STR para dar respuestas cumpliendo las restricciones temporales depende del software de tiempo real, asumiendo que los diseñadores del sistema han elegido el hardware adecuado para el procesamiento (Butazzo, 2011; Shirvaikar y Elbert, 2018).
In general, the system is formed a set of tasks Ti where i is the task identification. Shirvaikar and Elbert (2018) point out that it is the fundamental element of the processing software.
En general, el sistema está formado un conjunto de tareas Ti donde i es la identificación de la misma. Shirvaikar y Elbert (2018) señalan que es el elemento fundamental del software de procesamiento.
Then, the task is defined as an executable entity Ti, formed by a set of instances τi,k, as shown in Figure 1.
Entonces, se define la tarea como una entidad ejecutable Ti, formada por un conjunto de instancias τi,k, como se muestra en la Figura 1.
Figure 1. Representation of the time characteristics of a Real-Time Task T1 in
instances τ1,1 and, τ1,2
Figura 1. Representación de las características temporales de una Tarea de Tiempo
Real T1 en dos instancias τ1,1 y τ1,2
The parameters are shown in Figure 1:
Los parámetros indicados en la Figura 1:
ri,k: activation time of Ti instances.
φi,k: delay due to the environment or execution of higher priority tasks.
li,k: start time of execution of instances ofTi.
κi,k: time of completion of the execution of instances of Ti.
di,k: absolute deadline.
Pabi: next arrival time of Ti.
ri,k: tiempo de activación de instancias de Ti.
φi,k: retardo por el entorno o ejecución de tareas de mayor prioridad.
li,k: tiempo de inicio de ejecución de instancias de Ti.
κi,k: tiempo de finalización de la ejecución de instancias de Ti.
di,k: plazo absoluto.
Pabi: próximo tiempo de arribo de Ti
With the instance:
Con la instancia:
where Ci,k is the computation time of task i at activation time k, Di,k the task completion time, Pi,k the activation period.
donde Ci,k es el tiempo de cómputo de la tarea i en el tiempo de activación k, Di,k el plazo de finalización de la tarea, Pi,k el período de activación.
Considered,
Se considera,
WCETi is the worst-case execution time.
WCETi es el peor tiempo de ejecución, por sus siglas en inglés (Worst-Case Execution Time)
fmin and fmax are the minimum and maximum operating frequencies of the computational system.
fmin y fmax son las frecuencias de operación mínimas y máximas del sistema computacional.
The following must also be met:
También se debe cumplir lo siguiente:
It is worth noting, that the magnitudes of Ci,k, Di,k and Pi,k of task i at activation time k, are due to the application and there are different procedures to obtain them.
Vale la pena destacar, que las magnitudes de Ci,k, Di,k y Pi,k de la tarea i en el tiempo de activación k, son debidas a la aplicación y existen diferentes procedimientos para obtenerlas.
As noted in the first post in this series for performing the tasks of an RTS must be had:
Como se señaló en el primer post de esta serie para la realización de las tareas de un STR se debe tener:
Taking the above into account, according to Shirvaikar and Elbert (2018) what represents a task is::
Tomando en cuenta lo anterior, según Shirvaikar y Elbert (2018) lo que representa una tarea es:
"a logically complete section of code that can be independently programmed for execution”
“una sección de código lógicamente completa que se puede programar de forma independiente para su ejecución”
This has been used by many authors in the field.
Lo cual ha sido utilizado por muchos autores del área.
Real-Time Task Classification
Clasificación de las Tareas de Tiempo Real
Tasks are classified according to their temporal characteristics into:
Las tareas se clasifican según sus características temporales en:
On the other hand, depending on the form of execution, they can be:
Por otro lado, en función de la forma de ejecución, pueden ser:
Example Time
Hora del Ejemplo
We take the time characteristics of three Ti tasks, indicated in Table 1, periodic and expulsive running on a processor whose operating frequency is 800 Mhz, power supply 3.8 V and contains three cores in its internal structure.
Se toman las características temporales de tres tareas Ti, señaladas en la Tabla 1, periódicas y expulsivas que se ejecutan en un procesador cuya frecuencia de operación es 800 Mhz, alimentación de 3,8 V y contiene tres núcleos en su estructura interna.
It is assumed that there are no challenges between the activations of Ti and that at t=0 the execution of the task starts τ1,1.
Se asume que no hay retados entre las activaciones de Ti y que en t=0 se da inicio a la ejecución de τ1,1.
Table 1 . Temporals characteristic of Ti in ms.
Tabla 1. Características temporales de Ti expresados en ms.
Figure 2. Temporal Characteristics of Ti of the example.
Figura 2. Características Temporales de Ti del ejemplo.
To obtain the Ci here is a practical way to do it by analyzing the executable code. The code is decomposed into sequential blocks, calculating the execution time of each of them, making several measurements and the largest or average of them is taken. The different programming languages or environments have the respective functions to count these times. It must be remembered that these are estimated times.
Para obtener los Ci aquí se indica una forma práctica de hacerlo analizando el código ejecutable. El código se descompone en bloques secuenciales, calculando el tiempo de ejecución de cada uno de ellos, haciendo varias medidas y se toma el mayor o promedio de ellos. Los diferentes lenguajes o entornos de programación tienen las funciones respectivas para contabilizar estos tiempos. Hay que recordar que son tiempos estimados.
As for the Pi, it is resolved to guide their magnitudes by the constraints of the application environment. For example, the sampling period and data acquisition synchronization, connection establishment of shared links, etc.
En cuanto a los Pi se resuelve guiar sus magnitudes por las restricciones del entorno de la aplicación. Por ejemplo, el período de muestreo y sincronización de adquisición de datos, establecimiento de conexión de enlaces compartidos, etc.
Figure 2 showed a temporal diagram showing the temporal characteristics of the Ti using concurrent computational resources that allow the RTS to execute the tasks simultaneously.
En la Figura 2 se mostró un diagrama temporal donde se señalan las características temporales de las Ti haciendo uso de recursos computacionales concurrentes que permiten al STR ejecutar las tareas simultáneamente.
We can observe it at t=50 ms where τ1,3 and τ2,1 are executed at the same time. As well as, so do at t=1000 ms the tasks τ1,51, τ2,21 and τ3, 1, respectively
Lo podemos observar en t=50 ms donde se ejecutan τ1,3 y τ2,1 al mismo tiempo. Así como también, lo hacen en t=1000 ms las tareas τ1,51, τ2,21 y τ3, 1, respectivamente.
The execution shown in Figure 1 would change if the number of processor cores was less than three because fewer resources would be available for processing. In this case, a decision would have to be made as to which task would be executed first, thus requiring prioritization and bringing out the expulsive characteristic noted above.
La ejecución que se presenta en la Figura 1 cambiaría si el número de núcleos del procesador fuera menor que tres, porque se tendría menos recursos para el procesamiento. En este caso, se tendría que decidir cuál tarea se ejecutaría primero, por lo que se necesitaría establecer prioridades y se pondría de manifiesto la característica expulsiva anteriormente señalada.
Therefore, in order to know exactly the temporal behavior of the tasks of an RTS it is necessary to eliminate the indeterminism produced by concurrent execution, this is possible by means of scheduling. I will explain this issue in the next post on this topic.
Por tanto, para conocer con exactitud el comportamiento temporal de las tareas de un STR es necesario eliminar el indeterminismo que produce la ejecución concurrente, esto es posible por medio de la planificación. Asunto que explicaré en el próximo post de este tópico.
Another point of interest, if we use another processor with operating frequency and/or power supply voltage different from the silver one in the example, the computation times would vary. This introduces hurdles that an RTS must also overcome.
Otro punto de interés, si utilizamos otro procesador con frecuencia de operación y/o voltaje de alimentación diferente al plateado en el ejemplo, los tiempos de cómputo variarían. Lo que introduce obstáculos que también debe sortear un STR.
By way of closing
A manera de cierre
In this post, I presented the Real-ime Task and its characteristics as a fundamental part of this type of system.
En este post presenté lo referente a la Tarea de Tiempo Real y sus características como parte fundamental de este tipo de sistemas.
Extracting the temporal characteristics is not trivial at all, there is a relationship that comes from the logic and structure of the code involved. In addition, the characteristics of the processor involved and the essence of the application.
Extraer las características temporales no es para nada trivial, hay una relación que viene de la lógica y estructura del código involucrado. Además, de las características del procesador involucrado y la esencia de la aplicación.
So, we are ready for our next installment of this series in which I will be addressing Real-Time Systems Scheduling.
Entonces, estamos listos para nuestra siguiente entrega de esta serie en la cual estaré abordando la Planificación de los Sistemas de Tiempo Real.
See you soon, I hope you liked this post.
Nos vemos pronto, espero que les haya gustado este post.
Be sure to visit my other posts and follow me @alfonsoalfonsi.
No dejes de visitar mis otros posts y seguirme en @alfonsoalfonsi.
The contents and images are developed by the author.
Los contenidos e imágenes están desarrollados por el autor.
Thank you for your time and comments.
Gracias por su tiempo y comentarios.
Publication Series Real-Time Systems by @alfonsoalfonsi
Serie de Publicaciones Sistemas de Tiempo Real por @alfonsoalfonsi
Alfonsi, A. [@alfonsoalfonsi] (2021, May 29). [Eng-Spa] Real-time Systems: Concept and Context // Sistema de Tiempo Real: Concepto y Contexto.
References
Referencias
Alfonsi, A., Pérez, J. y Dunia, E. (2013). Arquitectura de Control Multifrecuencia para el Ajuste Dinámico del Consumo de Energía en Tareas de Tiempo Real. Revista Multidisciplinaria del Consejo de Investigación de la Universidad de Oriente SABER, 25(2), 202-209.
https://www.redalyc.org/articulo.oa?id=427739462010
Alfonsi, A y Pérez, J. (2009). Sistema de Control en Tiempo Real para una Planta Piloto Compacta usando Software Libre. Revista Universidad Ciencia y Tecnología, 13(52), 189-198.
Butazzo, G. (2011). Hard Real-Time Computing Systems: Predictable Scheduling Algoritms and Applications (3rd ed.). Springer Science/Business Media.
Shirvaikar, M. y Elbert, T. (2018). Fundamentals of Real Time Systems. Cognella, Inc.
Stankovic, J. A. (1988). Misconceptions About Real-Time Computing: A Serius Problem for Next-Generations Systems. Computer, 21(10), 10-19. https://doi.org/10.1109/2.7053
Young, S. (2000). Real Time Languages Desing and Developments. Ellis Horwood.
https://dl.acm.org/doi/abs/10.5555/69567
Figures and Images
Figuras e Imágenes
The Home or Title image was made by @alfonsoalfonsi using CANVAS and the image by from PxHere
La imagen de Inicio o Título fue realizado por @alfonsoalfonsi usando CANVAS e imagen de PxHere
The banner and the photographs on it are my property. Made with Power Point, Paint and the Linerock Investment LTD ToonMe App.
El banner y las fotografías son de mi propiedad. Realizado con Power Point, Paint y Linerock Investment LTD Aplicación ToonMe.
The separator used is my own and is made using CANVAS and an image from PxHere
Los separadores son de mi propiedad y está realizado usando CANVAS e imagen de PxHere.