In this thesis, we worked on making asynchronous calls more efficient, targeting real-time operating systems suited for embedded systems, characterized by their low resources. We applied our research on Miosix, a real-time operating system developed at Politecnico di Milano. In most general-purpose asynchronous runtime environments, like the one implemented by the standard library of C++, when an asynchronous call is scheduled, a thread is created, allocating memory space on ram, and then executed. In case of a high number of asynchronous calls, especially if resources are low, this standard approach can lead to a high resource consumption and an overall slow down of the system. Working on a real-time operating systems means scheduling tasks based on their priority, calculated in relation to some task deadline or period, where the ones with the closest deadline needs to be scheduled earlier to ensure the correct functioning of the system. Our work centers around the implementation of an event-based scheduler that supports the scheduling of asynchronous calls based on priority. The main idea of our approach is to create an executor that instantiate threads for executing asynchronous calls, and it executes them based firstly on their priority, and then considering a FIFO order between the ones with the same priority. Our work is focused on avoiding the creation of new memory space for every asynchronous call, and guaranteeing that the number of executing tasks will not be higher than the number of CPU cores. As a result, we have lower memory usage and faster execution time, increased determinism, and absence of priority inversions.
In questa tesi, abbiamo lavorato per rendere piu efficienti le chiamate a funzioni asincrone in un contesto di sistemi operativi real-time applicati su sistemi embedded, che sono caratterizzati dalle scarse risorse hardware. Abbiamo applicato il nostro lavoro su Miosix, un sistema operativo real-time sviluppato al Politecnico di Milano. Nella maggior parte degli ambienti di esecuzione asincroni, come quello implementato dalla libreria standard di C++, quando viene chiamata una funzione asincrona, viene creato un thread che alloca spazio nella memoria RAM e poi viene eseguito. Nel caso di un numero elevato di chiamate asincrone, specialmente se le risorse sono limitate, questo approccio può portare a un elevato consumo di risorse e a un rallentamento complessivo del sistema. In un sistema operativo real-time lo scheduling delle task viene eseguito in base alla loro priorità, data dalla loro deadline o dal loro periodo, e quelle con priorità più alta devono essere esuguite prima delle altre per asscurarsi il corretto funzionamento del sistema. Il nostro lavoro si concentra sull’implementazione di uno scheduler di eventi che supporta la schedulazione di chiamate asincrone in base alla priorità. L’idea principale del nostro approccio è creare un esegutore che istanzia dei thread per l’esecuzione delle chiamate asincrone e le esegue prima in base alla loro priorità e poi seguendo un ordine FIFO tra quelle con la stessa priorità. In questo modo evitiamo di creare nuovo spazio di memoria per ogni chiamata asincrona e garantiamo che il numero di task in esecuzione non sia superiore al numero di core della CPU. Come Risultato otteniamo un minore utilizzo della memoria e tempi di esecuzione più brevi, un maggiore determinismo e l’assenza di inversioni di priorità.
Priority aware asynchronous programming for embedded real-time systems
ROMANÒ, LUCA
2024/2025
Abstract
In this thesis, we worked on making asynchronous calls more efficient, targeting real-time operating systems suited for embedded systems, characterized by their low resources. We applied our research on Miosix, a real-time operating system developed at Politecnico di Milano. In most general-purpose asynchronous runtime environments, like the one implemented by the standard library of C++, when an asynchronous call is scheduled, a thread is created, allocating memory space on ram, and then executed. In case of a high number of asynchronous calls, especially if resources are low, this standard approach can lead to a high resource consumption and an overall slow down of the system. Working on a real-time operating systems means scheduling tasks based on their priority, calculated in relation to some task deadline or period, where the ones with the closest deadline needs to be scheduled earlier to ensure the correct functioning of the system. Our work centers around the implementation of an event-based scheduler that supports the scheduling of asynchronous calls based on priority. The main idea of our approach is to create an executor that instantiate threads for executing asynchronous calls, and it executes them based firstly on their priority, and then considering a FIFO order between the ones with the same priority. Our work is focused on avoiding the creation of new memory space for every asynchronous call, and guaranteeing that the number of executing tasks will not be higher than the number of CPU cores. As a result, we have lower memory usage and faster execution time, increased determinism, and absence of priority inversions.| File | Dimensione | Formato | |
|---|---|---|---|
|
2026_03_Romanò.pdf
accessibile in internet per tutti
Descrizione: Contenuto della tesi
Dimensione
864.85 kB
Formato
Adobe PDF
|
864.85 kB | Adobe PDF | Visualizza/Apri |
|
2026_03_Romanò_Executive_Summary.pdf
accessibile in internet per tutti
Descrizione: Contenuto dell'executive summary
Dimensione
431.97 kB
Formato
Adobe PDF
|
431.97 kB | Adobe PDF | Visualizza/Apri |
I documenti in POLITesi sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.
https://hdl.handle.net/10589/252918