摘要
实时多线程是实时控制软件实现的重要手段,但是基于Linux/RTLinux的实时控制软件的多线程实时性检测不易,尤其连续输出大量测试信息困难。设计了三种多线程的实时性检测方法,并分析了其优缺点。重点讨论了使用rtl-printf函数和dmesg命令协同输出测试信息的这一随机采样的测试方法,并给出设计细节和应用实例。分析如应用表明,这种使用rtl-printf和dmesg输出信息的测试方法在需要连续采集大量数据、随机采样能够满足要求的场合下是有效的。
Real - time multi - thread is an important implementation method of real - time control software. However, it is difficult to test the real - time performance of real - time multi- thread of control software based on Linux/RTLinux, especially when outputting large amount of test - messages continuously is desired. Three methods were designed to test the real - time performance of multi - thread, whose advantages and disadvantages were analyzed. Moreover, the random sampling method that uses the function rtl_ printf and command dmesg together to output test- message was discussed in detail. And an application example was also given. The analysis and application showed this method is effective when a large amount of data is needed to be collected continuously and when random sampling meets the testing requirement.
出处
《计算机技术与发展》
2010年第3期113-115,120,共4页
Computer Technology and Development
基金
四川省科技厅科技支撑项目(2009GZ0009)