VC中实现的生产者和消费者问题的算法。此为转帖,算法讲的不错。-VC achieve producers and consumers of the algorithm. This was patented algorithm for the good. 下载
|
采用超前检测的算法解决传统的生产者消费者问题中的死锁情况,并含有详细的设计文档和测试程序-using advanced detection algorithms to solve the traditional problems of the producers and consumers of deadlock, and contains detailed design documentation and testing procedures 下载
|
本文从信号量、管程和消息传递三个方面讨论了进程间的同步问题,并分别给出了关于生产者/消费者问题的解决算法,最终还分析了以上三种方法的优缺点。 -signal from the amount of paper tube and messaging three discussed the process of synchronization and were given on the producer / consumer problem solving algorithm, ultimately analysis of the above three methods are discussed. 下载
|
基于DOS的多任务系统的实现 1. 用C语言完成线程的创建和撤消,并按优先权加时间片轮转算法对多个线程进行调度; 2. 改变时间片的大小,观察结果的变化。思考:为什么时间片不能太小或太大; 3. 假设两个线程共用同一软件资源(如某一变量,或某一数据结构),请用记录型信号量来实现对它的互斥访问; 4. 假设有两个线程共享一个可存放5个整数的缓冲,一线程不停的计算1到50的平方,并将结果放入缓冲中,另一个线程不断的从缓冲中取出结果,并将他们打印出来,请用记录型信号量实现这一生产者和消费者的同步问题; 5. 实现消息缓冲通信,并于3,4中的简单通信进行比较; 6. 思考:在线程间进行消息缓冲通信时,若对消息队列的访问没有满足互斥要求,情况会怎么样?-DOS-based multi-tasking system in a. C language to complete the creation and thread lift Priority increase as time slice Web algorithm for multiple-thread scheduling; 2. change the timing of the unit size, The results change. Thoughts : Why not films too little time or too much; 3. Assuming two threads to share the same software resources (such as a variable, or a data structure), with record-volume signal to achieve its exclusive interviews. 4. Suppose two threads share a deposit of five integer buffer keep a thread of 1-50 calculating the square, and the results Add buffer, Another constant thread removed from the buffer, and print them out, Please record-volume signal achieve this producers and consumers synchronization; 5. Implementation news buffer communications, and 3, 4 simple comm 下载
|