问题 单项选择题

假设系统处于安全状态,目前系统剩余资源数量为2。下列________进程序列不是安全序列。

A.P1, P2, P3, P4

B.P2, P3, P4, P1

C.P3,P1,P2,P4

D.P4,P3,P2,P1

答案

参考答案:B

解析:[评析] 所谓系统处于安全状态指的是:对于一个系统中所有进程构成的队列: <P1,P2,…,Pn>如果对于每一个进程Pi(1≤i≤n),其以后所需要的资源数量不超过系统当前剩余资源数量与其余的进程巧 (j<i)当前占用资源之和。这时我们称这样的进程序列是安全的。 选项A,要完成p1还需要1个资源。剩余2个资源,可以满足它,然后p1释放资源,这时系统剩下3个资源,可以满足p2,然后p2完成释放资源,这时系统剩下7个资源,可以满足p3,然后p3完成释放资源,这时系统剩下10个资源,可以满足p4,所以此进程序列不会引起死锁。 选项B,当先处理p2时,系统只剩下2个资源,不能满足p2,所以p2不能完成,p2又不会释放自己的资源,所以出现了死锁的条件,保持等待,所以会死锁。 选项C、D以此类推。

阅读理解

At 18, many American young people go off on their own. They go away to college or find full-time jobs, and they often pay for their own apartments. Some get married and start families. This independence(独立) is learned from childhood.

From an early age, American children learn to do things by themselves. Children as young as 2 begin to put away their toys and dress themselves. At 3, many children do simple chores like setting the table.

Using money in the right way is also taught early. As soon as a child understands the value of money, he or she receives a weekly allowance. This is used for things the child wants, like toys or treats. The child can spend or save it, usually with little help or advice from parents. If the child wants more money, it must be earned by doing extra chores.

Children are taught early in life to think for themselves. They are allowed to make some decisions

and make mistakes. Failure often teaches more than success.

小题1:. Many young American people begin to live on themselves ________ .

A.at the age of eighteen

B.from an early age

C.after they get married

D.when they find jobs小题2: An American child learns to ________ at the age of 2.

A. do a lot of chores  B. put on their own clothes     C. study for a test        D set the table

小题3: The underlined word “allowance” means ________ .

A.pocket money

B.present

C.prize

D.toy小题4: A child can get some more money by ________ .

A.understanding the value of money

B.doing a lot of homework

C.reading a lot of books

D.doing some more chores小题5: Which is NOT true according to the passage?

A.American children learn to be independent from an early age.

B.American children always use or save their money with the help of their mother.

C.American children are allowed to make some decisions and mistakes.

D.Failure is needed in children’s life as well as success.

单项选择题