Real-Time Analysis of Event Response Based on RT-Thread - Hui Liu; Wenyin Tao; Zhixin Hong; Lianmin Shi (IEEE Access)
The event response is a crucial feature in the real-time operating system RT-Thread, used for synchronizing threads. This paper aims to analyze the real-time performance of the event response and provide practical insights for its application. To achieve this, a low-latency piling timing analysis approach is proposed. The precise measurement of thread scheduling time is achieved by accurately recording timestamp of critical moments without external interruptions. Moreover, the theoretical time of thread scheduling under different compilation optimization levels is analyzed. And, a thread synchronization experiment based on event response is designed to measure the actual time of thread scheduling on Arm Cortex-M4 microcontroller STM32L431RCT6. The experimental results show that the low-latency piling timing analysis approach proposed in this paper has an error of about 1.5 microseconds compared to the measurement time of the logic analyzer and the theoretical analysis time. Finally, by comparing and analyzing theoretical time and actual measurement time of thread scheduling, it is evident that the compilation optimization level and PendSV exception are the key factors influencing the real-time performance of RT-Thread event response.