作业帮 > 综合 > 作业

一道关于操作系统的题目,是临界区问题还是信号量问题?请写出代码?

来源:学生作业帮 编辑:百度作业网作业帮 分类:综合作业 时间:2024/08/11 21:33:05
一道关于操作系统的题目,是临界区问题还是信号量问题?请写出代码?
There is only one single-log bridge(独木桥) over the river connecting the west and the east.If there is some one on the bridge,people from other direction must wait until there is no person on the bridge.While if several people go the same direction,they can pass through at the same time.Write a code sketch for two kinds of people,people from west to east and people from east to west,which follows the given rules and guarantees that two kinds of people are never on the bridge at the same time using semaphores.
一道关于操作系统的题目,是临界区问题还是信号量问题?请写出代码?
信号量问题啊