竞态条件使得多个任务对共享资源进行操作的先后顺序在不同的执行情况下发生改变,从而可能引起系统异常.为了分析实时嵌入式系统可能出现的竞态条件及其所带来的影响,根据目标系统的执行特征,建立系统的执行序列模型,对相关的竞态条件进行精确描述,并在此基础上提出一种竞态集来存储和分析系统的竞态条件,然后利用获取到的竞态集,构建系统的竞态条件图来预测系统潜在的竞态同步关系.实验分析表明该方法能够有效地分析和预测目标系统各种可能的竞态同步关系及其所带来的不同执行情况和结果.
In real-time embedded systems, due to race conditions, synchronization order of operations to the shared variables or shared resource during the multiple tasks may be different from one execution to another. This may cause abnormal behaviors of systems. In order to detect the possible race conditions and analyze the impacts of race conditions effectively in real-time embedded systems, a formal model of execution sequences and operation events are presented according to the timing behaviors and execution characteristics of real-time embedded systems. Their characteristics are also discussed. Based on the execution sequence model, race conditions including message races and semaphore races in real-time embedded systems are described formally and precisely. And then, a new race set is presented to describe and store race conditions in systems. It includes the information of happened-before relations and race synchronization relations among the operation events which have races. With the race set generated, a race condition graph is constructed to visualize the race conditions. It is also used to predict the potential race synchronization relations of systems. The case study shows that the approach proposed can be used to analyze and predict efficiently the potential race synchronization relations as well as the different execution situations and results of real-time embedded systems.