资 源 简 介
用线程做一个生产者-消费者同步问题 其实我是想用线程做一个生产者-消费者同步问题,现在已经成功了,贴出来,大家请指证. 我想让线程thread1和thread2按顺序显示,于是加了个信号量mysem,并且在新建两个线程的两个函数中进行P,V操作,来控制先后显示顺序-threads do with a producer-consumer Synchronization I actually want to do with threaded a producer-consumer synchronization issue, it is a success and put them out, please refer to certification. I want threaded thread1 and thread2 sequence, then added a signal mysem volume, and the new two threads of two function for the P, V operation, to control the sequence has revealed