期刊文献+

实时操作系统mbedOS互斥量调度机制剖析 被引量:1

Anatomy of mutex scheduling mechanism of RTOS mbedOS
下载PDF
导出
摘要 嵌入式产品研发中使用多线程并发运行时,为避免公共资源被破坏或线程运行异常,通常使用互斥量(Mutex)来防止公共资源在线程运行时被其他线程抢占。不同于使用单一变量实现的互斥量,在实时操作系统中为优化线程调度并避免错误,所使用的互斥量较复杂且不易理解。目前关于嵌入式实时操作系统中互斥量的实现及应用的相关资料较少,文中在对实时操作系统mbedOS中互斥量的数据结构与操作函数进行详细分析的基础上,设计出一个使用互斥量保护公共资源的软件实例,实例中包含对小灯的控制以及使用串口输出线程的实时运行情况。通过观察灯光的变化并结合串口输出信息,能够直观地理解mbedOS对使用互斥量的进程调度机制,也可为读者理解其他实时操作系统中互斥量的机制提供参考。 When concurrent operation of the multithreading is used in embedded product development,mutex is often used to prevent common resources from being preempted by other threads when thread running to avoid common resources being destroyed or abnormal thread operation. In the system,the mutex being complex and difficult to understand is used to optimize thread scheduling and avoid errors,because it is unlike the mutex implemented with a single variable. At present,there is a lack of relevant information about the implementation and application of mutex in embedded RTOS(real-time operating system).Based on the detailed analysis of the data structure and operation function of mutex in RTOS mbedOS,a software example using mutex to protect common resource is designed. The example includes the control of the small lamps and the real-time operation of the serial output thread. By observing the change of light and combining the serial port output information,the process scheduling mechanism of mbedOS for using mutex can be understood intuitively. It can also provide a reference for readers to understand the mechanism of mutex in other RTOSs.
作者 王庭琛 王宜怀 陈瑞雪 WANG Tingchen;WANG Yihuai;CHEN Ruixue(School of Computer and Science Technology,Soochow University,Suzhou 215006,China)
出处 《现代电子技术》 2022年第8期93-100,共8页 Modern Electronics Technique
基金 国家自然科学基金项目(61672369)。
关键词 实时操作系统mbedOS 互斥量调度 软件设计 调度机制 多线程运行 三色灯控制 实例分析 RTOS mbedOS mutex dispatch softare design dispatch mechanism multithreading operation tricolour light control instance analysis
  • 相关文献

参考文献4

二级参考文献37

共引文献24

同被引文献14

引证文献1

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部