单选

●桌上有一个空盒,盒内只允许放一个水果。爸爸专向盒内放苹果,妈妈专向盒内放桔子,儿子等着吃盒中的水果(苹果或桔子)。若盒内已有水果,放者必须等待,若盒内没有水果,吃者必须等待。用PV操作来协调3人的关系。请回答下列问题:

①应设置的信号量及其初值为SP和1。

②在3组工作流程的虚线位置填上适当的PV操作,实现3人正确的活动。

爸:准备

P(SP)

向盒内放苹果

 (15) 

妈:准备

 (16) 

向盒内放桔子

 (17) 

儿:

 (18) 

拿盒中的水果(苹果或桔子)

 (19) 

吃水果(苹果或桔子)

 (15) ~(19)

  • A.P(SP)    &n
  • bsp;  B.P(SG)    
  • C.V(SG)    
  • D.V(SP)
参考答案
您可能感兴趣的试题

●MIMD systems c

  • an
  • be
  • classifie
  • d into(71)oriented systems,highavailability systems and responseoriented systems.The goal of(71).orlented multiprocessing is to obtain high(71)(72)minimal computing cost.The techniques employed by multiprocessor operating systems to achieve this goal t

●Prior to the UML,there w

  • as no clearleading&n
  • bsp;(66) language.Users had to
  • choose from among many similar mo
  • deling languages with minor differences in overall (67) power.Most of the modeling languages shared a set of commonly accepted concepts that are expressed slightly differently in various languages.This lack of (68) discouraged new user
  • B.modeling
  • C.formal
  • D.intelligent    (67) A.control
  • B.expressive
  • C.conductive
  • D.interactive    (68) A.agreement

对长度为n的顺序表进行顺序查找的时间复杂度为 () 。

  • A.O(n)
  • B.O([log2n])
  • C.O([log2](n+1))
  • D.O(n2)

●对于一个线性表既要求能够进行较快的插入和删除,又要求存储结构能够反应数据之间的逻辑关系,则应该用 (42) 。

(42)

  • A.顺序方式存储    &n
  • bsp;  B.链接方式存储    
  • C.散列方式存储    
  • D.以上方式均可
¥

订单号:

遇到问题请联系在线客服

订单号:

遇到问题请联系在线客服