假设系统有n (n5)个并发进程共享资源R,且资源R的可用数为3。若采用PV操作,则相应的信号量S的取值范围应为( )。
- A.-3~n-5
- B.-3~5
- C.-(n-5)~5
- D.-(n-3)~3
正确答案及解析
正确答案
解析
PV操作与信号量的处理相关,P表示通过的意思,V表示释放的意思。一般来说,信号量S大于等于0时,S表示可用资源的数量。执行一次P操作意味着请求分配一个单位资源,因此S的值减1;当S小于0时,表示已经没有可用资源,请求者必须等待别的进程释放该类资源,它才能运行下去。而执行一个V操作意味着释放一个单位资源,因此S的值加1;若S小于0,表示有某些进程正在等待该资源,因此要唤醒一个等待状态的进程,使之运行下去。初始值资源数为3,所以信号量S的最大值是3,n进程申请,则信号量S的最小值为3-n,也就是 -(n-3)。
你可能感兴趣的试题
Advancements in ( )have contributed to the growth of the automotive industry through the creation and evolution of self-driving vehicles.
-
- A.Artificial Intelligence
- B.Cloud Computing
- C.Internet of Things
- D.Big Data
- 查看答案
In project human resource management , ( )is not a source of power for the project manager.
-
- A.referent power
- B.expert power
- C.reward power
- D.audit power
- 查看答案
At the project establishment stage , the feasibility study mainly includes techinical feasibility analysis , ( ), operation environment feasibility analysis and other aspects of feasibility analysis.
-
- A.detail feasibility analysis
- B.opportunity analysis
- C.economic feasibility analysis
- D.risk analysis
- 查看答案
( )is a grid that shows the project resources assigned to each work package.
-
- A.Stakeholder engagement assessment matrix
- B.Requirements traceability matrix
- C.Probability and impact matrix
- D.Responsibility assignment matrix
- 查看答案
Xinhua News Agency reported in January 2022,Chian will further promote the developmet of a digital economy during the 14th Five-Year Plan eriod(2021-2025). The plan also emphasized industrial ( )transformation.
-
- A.digital
- B.networking
- C.intelligentize
- D.informatization
- 查看答案