Mutex Scheduling Mechanism Analysis and Performance Evaluation under the RT-Thread Open Source Framework

A mutex is an important synchronization tool in real-time operating systems (RTOS) used to protect shared resources, ensuring that at any given moment only one thread can access the resource. This prevents race conditions and data conflicts. This paper provides an in-depth analysis of the application scenarios, workflow, and scheduling timing of mutexes in RT-Thread, offering insights and reference points for designing new RTOSs.Using the RT-Thread on the ARM Cortex-M series STM32L431 microcontroller as an example, we designed three threads of equal priority (red light, blue light, green light) to demonstrate how threads request, acquire, use, and release mutexes. This design verifies that using mutexes ensures that threads access shared resources in a sequential and mutually exclusive manner, thereby avoiding issues such as data inconsistency and deadlocks.Furthermore, this paper adopts a process analysis method based on printf output, innovatively utilizing global variables to store timestamps combined with the SysTick timer for time calculation. This approach not only analyzes the response times for locking and unlocking mutexes but also examines the distribution of time during which threads hold the mutex. By effectively reducing the error introduced by the printf function, this method enhances the accuracy of experimental results, providing a new perspective for comprehensively evaluating the performance of mutex scheduling mechanisms.

Authors

Institutions

Publication Details

Published
2025-05-23
DOI
https://doi.org/10.1109/ecis65594.2025.11086967
Primary Topic
Distributed and Parallel Computing Systems
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Mutex Scheduling Mechanism Analysis and Performance Evaluation under the RT-Thread Open Source Framework

Yihuai Wang, C. T. Sun, Qianglong Dai
Distributed and Parallel Computing Systems
article

Mutex Scheduling Mechanism Analysis and Performance Evaluation under the RT-Thread Open Source Framework

Yihuai Wang, C. T. Sun, Qianglong Dai
article en

Abstract

A mutex is an important synchronization tool in real-time operating systems (RTOS) used to protect shared resources, ensuring that at any given moment only one thread can access the resource. This prevents race conditions and data conflicts. This paper provides an in-depth analysis of the application scenarios, workflow, and scheduling timing of mutexes in RT-Thread, offering insights and reference points for designing new RTOSs.Using the RT-Thread on the ARM Cortex-M series STM32L431 microcontroller as an example, we designed three threads of equal priority (red light, blue light, green light) to demonstrate how threads request, acquire, use, and release mutexes. This design verifies that using mutexes ensures that threads access shared resources in a sequential and mutually exclusive manner, thereby avoiding issues such as data inconsistency and deadlocks.Furthermore, this paper adopts a process analysis method based on printf output, innovatively utilizing global variables to store timestamps combined with the SysTick timer for time calculation. This approach not only analyzes the response times for locking and unlocking mutexes but also examines the distribution of time during which threads hold the mutex. By effectively reducing the error introduced by the printf function, this method enhances the accuracy of experimental results, providing a new perspective for comprehensively evaluating the performance of mutex scheduling mechanisms.

Suzhou University of Science and Technology (CN)
Openalex Percentile: Top 77%
Distributed and Parallel Computing Systems
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.