[Eng-Spa] Real-Time System: Real-time Task

Inico.jpg

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).

Separador 2.jpg

What is a Real-Time Task?

¿Qué es una Tarea de Tiempo Real?

Separador 2.jpg

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.


Tarea fig1.jpg
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:


image.png

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,


image.png

image.png

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:


image.png

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:


  • Representation of interrupts and context switching.
  • Concurrency, as manifested in multitasking and multiprocessing.
  • Communication and synchronization between tasks.
  • Wide variations between data processing and communication processes.
  • Representation of time bindings.
  • Special requirements for error handling and fault recovery.
  • Asynchronous processing.
  • Coupling of software with operating systems, with hardware and with other elements external to the system.
  • Representación de interrupciones y cambio de contexto.
  • Concurrencia, tal como se manifiesta en multitarea y multiprocesamiento.
  • Comunicación y sincronización entre tareas.
  • Amplias variaciones entre el tratamiento de datos y procesos de comunicación.
  • Representación de las ligaduras de tiempo.
  • Requerimientos especiales para manejo de errores y recuperación de fallas.
  • Procesamiento asíncrono.
  • Acoplamiento del software con sistemas operativos, con el hardware y con otros elementos externos al sistema.

  • 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.

    Separador 2.jpg

    Real-Time Task Classification

    Clasificación de las Tareas de Tiempo Real

    Separador 2.jpg

    Tasks are classified according to their temporal characteristics into:

    Las tareas se clasifican según sus características temporales en:


  • Periodic, those whose execution must be repeated at constant time intervals.
  • Aperiodic, they can be executed in unpredictable time instants, typical examples are the events generated by alarms.
  • Without deadline, they are characterized by Ci.
  • With firm deadline: they have a non-critical execution deadline and are characterized by Ci and Di.
  • Sporadic, they must end before a deadline, they are defined with the same parameters as a periodic task, taking into account that the period indicates the minimum time between two consecutive activations.
  • Periódicas, aquellas que su ejecución debe repetirse a intervalos constantes de tiempo.
  • Aperiódicas, pueden ejecutarse en instantes de tiempo impredecibles, ejemplo típico son los eventos generados por alarmas.
  • Sin plazo, se caracterizan por Ci.
  • Con plazo firme, tienen un plazo de ejecución que no es crítico y se caracterizan por Ci y Di.
  • Esporádicas, deben finalizar antes de un plazo, se definen con los mismos parámetros que una tarea periódica, teniendo en cuenta que el periodo indica el tiempo mínimo entre dos activaciones consecutivas.

  • 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:


  • Expulsive, one whose execution can be interrupted by other tasks and resumed later.
  • Non-Expulsive, which must be executed until its computation time is completed, without interruption.
  • Expulsiva, aquella cuya ejecución puede ser interrumpida por otras tareas y reanudada más tarde.
  • No Expulsiva, la cual debe ejecutarse hasta que se complete su tiempo de cómputo, sin interrupción.
  • Separador 2.jpg

    Example Time

    Hora del Ejemplo

    Separador 2.jpg

    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.
    Tabla1.jpg


    Ejem1.jpg
    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.

    Separador 2.jpg

    By way of closing

    A manera de cierre

    Separador 2.jpg

    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.


    Separador AA.jpg

    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.


    Separador AA.jpg

    Separador 2.jpg

    Publication Series Real-Time Systems by @alfonsoalfonsi

    Serie de Publicaciones Sistemas de Tiempo Real por @alfonsoalfonsi

    Separador 2.jpg

    Separador 2.jpg

    References

    Referencias

    Separador 2.jpg

    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

    Separador 2.jpg

    Baner ENG SPN.jpg

    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.

    H2
    H3
    H4
    3 columns
    2 columns
    1 column
    5 Comments
    Ecency