皮皮学,免费搜题
登录
搜题
【简答题】
桌上有一只盘子,最多可容纳 2 个水果,每次只能放入或取出 1 个水果。爸爸专向盘中放苹果,妈妈专向盘中放橘子;一个儿子专等吃盘子中的橘子,一个女儿专等吃盘中的苹果。试用信号量的 P 、 V 操作实现爸爸、妈妈、儿子、女儿之间的同步与互斥关系,补全下面代码中的空白。每个空白计 1 分。 Semaphore sEmpty = 空白 1 ; Semaphore sApple = 空白 2 ; Semaphore sOrange = 空白 3 ; Semaphore sMutex = 空白 4 ; void father() { while(true) { P( 空白 5 ); P( 空白 6 ); 向盘中放苹果 V(sMutex) V(sApple) } } void mother() { while(true) { P(sEmpty); P(sMutex); 向盘中放橘子 V(sMutex) V( 空白 7 ) } } void son( ) { while(true) { P(sOrange); P(sMutex); 从盘中取橘子 V(sMutex); V(sEmpty); 吃橘子 } } void daughter( ) { while(true) { P( 空白 8 ); P(sMutex); 从盘中取苹果 V(sMutex); V(sEmpty); 吃苹果 } }
拍照语音搜题,微信中搜索"皮皮学"使用
参考答案:
参考解析:
知识点:
.
..
皮皮学刷刷变学霸
举一反三
【单选题】Assume that labor is the only factor of production and that wages in the United States equal $20 per hour while wages in Japan are $10 per hour. Production costs would be lower in the United States as...
A.
U.S. labor productivity equaled 40 units per hour and Japan's 15 units per hour.
B.
U.S. labor productivity equaled 30 units per hour and Japan's 20 units per hour.
C.
U.S. labor productivity equaled 20 units per hour and Japan's 30 units per hour.
D.
U.S. labor productivity equaled 15 units per hour and Japan's 25 units per hour.
【单选题】Assume that labor is the only factor of production and that wages in the United States equal $20 per hour while wages in Japan are $10 per hour. Production costs would be lower in the United States as...
A.
U.S. labor productivity equaled 40 units per hour and Japan's 15 units per hour.
B.
U.S. labor productivity equaled 15 units per hour and Japan's 25 units per hour.
C.
U.S. labor productivity equaled 15 units per hour and Japan's 40 units per hour.
D.
U.S. labor productivity equaled 30 units per hour and Japan's 20 units per hour.
E.
U.S. labor productivity equaled 20 units per hour and Japan's 30 units per hour.
【单选题】Assume that labor is the only factor of production and that wages in the United States equal $20 per hour while wages in Japan are $10 per hour. Production costs would be lower in the United States as...
A.
U.S. labor productivity equaled 40 units per hour and Japan's 15 units per hour.
B.
U.S. labor productivity equaled 30 units per hour and Japan's 20 units per hour.
C.
U.S. labor productivity equaled 20 units per hour and Japan's 30 units per hour.
D.
U.S. labor productivity equaled 15 units per hour and Japan's 25 units per hour.
E.
U.S. labor productivity equaled 15 units per hour and Japan's 40 units per hour.
【多选题】以下哪些教是发源于耶路撒冷?
A.
犹太教
B.
基督教
C.
佛教
D.
伊斯兰教
E.
天主教
【判断题】在维修中尽量不要采用拔下高压线的方法进行试火或断缸实验
A.
正确
B.
错误
【简答题】Production of Rice Rice gives more (35) per hectare than other cereal crops and production has increased over 100% in recent years because of better yields. Land area has only increased by 30% due to ...
【单选题】The percent decrease in average number of production hours per widget from 1990 to 2000 was approximately
A.
44%
B.
36%
C.
34%
D.
32%
E.
27%
【简答题】Assumethat labor is the only factor of production and that wages in the United Statesequal $20 per hour while wages in Japan are $10 per hour. Production costswould be lower in the United States as co...
【单选题】I live in Beijing with my __.
A.
parents
B.
parent's
C.
parents'
【单选题】The index of industrial production ______ last year.
A.
raised up by 4 per cent
B.
rose up with 4 per cent
C.
arose up with 4 per cent
D.
went up by 4 per cent
相关题目: