搜索资源列表
daima
- 睡眠理发师问题源码,理发店有一位理发师,一把理发椅和n把用来等候理发的椅子。如果没有顾客,则理发师在理发椅上睡觉,顾客理来时,如理发师闲则理发,否则如有空椅则坐等,没有空椅则离开,编写程序实现理发师和顾客程序,实现进程控制,要求不能出现竞争。-This is a classic problem of IPC, there is a barber barber shop, a barber chair and n barber chair waiting to be used. If there
thread
- 生产者,消费者线程并发进行,生产者发现缓冲区满了则唤醒消费者,自己睡眠。消费者发现缓冲区空了,唤醒生产者,自己睡眠。-The producer, the consumer thread, producers have found that the buffer is full, wake up the consumers, their sleep. Consumers find the buffer is empty, awaken the producers, their sleep.
