问题 问答题

如果信号量S的初值是5,现在信号量的值是-5,那么系统中的相关进程至少执行了几个P(S)操作与信号量S相关的处于阻塞状态的进程有几个如果要使信号量S的值大于0,应该进行怎样的操作

答案

参考答案:(1)因为每执行一次P操作S的值减1,5-(-5)=10,在这期间有可能有进程执行V操作,使S的值加1,所以至少执行了10次P(S)。
(2)5个。
(3)6个V(S)或5个以上。

解析: 本题考查对信号量概念的理解,主要根据信号量的物理意义进行解答。

单项选择题
阅读理解

True friends double your happiness and half your burdens.Basically how you would like a true friend to be is what you should be like to your true friends.Trust,forgiveness,

responsibility are some elements of a true friendship.True friendships are hard to achieve.

And what’s more,life is short.So treasure these friends if you already have them.If you don’t,

continue to search,because once you have them,life will become so much easier to live,no matter what happens.I have been through very difficult times and I dare say,without my friends,

I would not have made it.

Friendships need lots of energy and patience to maintain them.Not to mention time.When your friend needs you,and when things are not going too well on your side,it is often so easy to  turn a deaf ear to  their requests.It is especially during these times that you must find the strength to help your friend.

And it is during these times that your friendship will be made stronger.

And you must always be happy for their successes,even when things are not going too well for you.It might be hard to do this,but it is something that you need to learn.Think about all the sacrifices your friend has made for you and all the times when he was happy for you despite his own troubles.Think  aboutall the happy times you enjoyed and the sad,difficult times you went through together.That should give you plenty of patience to actually be a true friend.Remember,true friends are the next best thing to family.They will always be your supporters.小题1: What is the best title for this passage?

A.A Precious Friendship

B.A True Friend

C.A Happy Time

D.Friend,a Treasure小题2:According to the passage,to be a true friend,you do NOT need to ___ .

A.trust your friends

B.forgive your friends’ mistakes

C.spend much money on friends

D.be helpful to your friends小题3:True friendships are hard to achieve because ____.

A.friendships can help you through difficult times

B.friendships need lots of energy and patience

C.your friends need you to give more help to them

D.you should be always on your friends’ side小题4:The underlined phrase “turn a deaf ear to” in Paragraph 2 probably means “______”.   

A.pretend not to know

B.take no measures to

C.have no means to

D.turn to a deaf for小题5:From Paragraph 3,we can conclude that          .

A.a friend won’t achieve success without your support

B.most people in trouble are not happy about their friends’ successes

C.you should support your friends on any conditions

D.a true friend appears only when you have troubles