基于信号量的生产者-消费者问题设计与分析  被引量:7

Design and Analysis of Producer-consumer Problem Based on Semaphore Mechanism

在线阅读下载全文

作  者:刘晓平[1] 石慧[1] 凌实[1] 杜琳[1] 田卫东[1] 

机构地区:[1]合肥工业大学计算机与信息学院,合肥230009

出  处:《合肥工业大学学报(社会科学版)》2008年第5期84-88,共5页Journal of Hefei University of Technology(Social Sciences)

基  金:国家自然科学基金资助项目(60673028)

摘  要:生产者-消费者问题是操作系统课程教学中进程同步与互斥的经典问题,深刻理解此问题对理解操作系统中的进程管理具有重要意义。文章应用可视化的方法、基于多线程方式,对生产者-消费者问题进行了模拟,并通过实际测试比较了生产者、消费者之间设置单一互斥信号量与设置两个互斥信号量两种不同方式对程序运行效率的影响。在给学生以直观映像的同时,引导学生对此问题进行深入思考,激发学生的创新意识。Producer-consumer problem is a classic example of processes synchronization and mutual exclusion in teaching of operating system. Deep understanding that is of great significance for right understanding of the process management. In this paper, a multi-threaded based simulation programming of this problem is presented. Two different semaphore mechanisms: producer and consumer processes with shared mutex or two different mutexes, are compared on the impact of operational efficiency by actual test. In addition to a visual image to students, it can also guide students on the problem in-depth reflection and inspire their awareness of innovation.

关 键 词:操作系统 生产者-消费者问题 进程同步 可视化 程序设计 

分 类 号:TP391[自动化与计算机技术—计算机应用技术]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象