数据竞争问题是并发程序开发与测试难题,发现数据竞争可能导致计算重复,重复会导致系统性能下降.从实例出发定义了并发计算重复问题(concurrentcomputationredundancyproblem,简称CCRP),给出了相关性能指标和判断方法,设计了通用并发重复控制机制.并发程序一般都可以基于生产者一消费者模型进行CCRP分析.以带数据源的生产者.消费者为例详细分析了CCRP,给出了单条件、条件交叉两种重复控制算法’算法具有不同的适用范围,都可以作为固定模式来解决CCRP,基于Petri网作了相关性质的证明与仿真.并发程序实验结果说明了并发重复控制的必要性和有效性,比较了两种算法的差异.该研究对于数据竞争检测、并发程序设计具有参考价值.
Data race is a difficult problem for the development and testing of the concurrent program. Research has found that data race may cause duplicate computing which may decrease a system's performance. First, the concurrent computation redundancy problem (CCRP) is defined. The related performance index and judging methods are given, and the general concurrent redundancy control mechanism is designed. When CCRP is studied, the parallel program generally be analyzed based on a producer-consumer model. In the case of the producerconsumer model with data source, CCRP is analyzed in detail. The single condition and cross condition redundancy control algorithms have different application scopes and can be used as fixed pattems to solve CCRP. Relative property proofs and simulations are given based on Petri net. The concurrent program experiments show that the concurrent redundancy control is necessary and efficient. Two control algorithms are compared in the experiments. The research has reference value for data race detection and concurrent programming.