问题 单项选择题

假设系统中有三类互斥资源R1,R2和R3,可用资源数分别为9,8和5。在T0时刻系统中有P1,P2,P3,P4和P5五个进程,这些进程对资源的最大需求量和已分配资源数如表3-2所示。如果进程按()序列执行,那么系统状态是安全的。

表3-2进程对资源的需求

A.P1→P2→P4→P5→P3

B.P2→P1→P4→P5→P3

C.P2→P4→P5→P1→P3

D.P4→P2→P5→P1→P3

答案

参考答案:C

解析:

[分析]: 由题意,R1,R2的和R3最大资源数为9,8,5。R1,R2和R3的已分配资源总数为7,7和5。因此系统中R1,R2和R3的剩余可分配资源数为2,1,0。按照什么样的顺序分配剩余的资源而不会引起死锁是解决这个问题的关键。这样的顺序可能不止一种,但总的原则是:将剩余的资源分配给某一个可以顺利完成的进程,然后收回释放的资源,再次分配给另一个可以完成的进程,然后再次收回释放的资源。按照这样的顺序推进下去,就可以保证系统不会死锁,才会是安全的。

对于本题,我们可以先把剩余资源分配给P2,因为它只需要一个R2资源。P2执行完毕后,系统的可用资源数增加到4,2,1。再把资源分配给P4,因为P4只需要1个只3资源。依次类推,按照P2→P4→P5→P1→P3的顺序执行,系统是安全的。

阅读理解

阅读理解。

     LONDON (Reuters)-New faces given to a Chinese man after a bear tore off part of his face

and a FrenchCaribbean man disfigured by a rare tumor show that such transplants can work and

are not medical oddities (怪异),researchers said.

     The findings give hope to some people with severe facial disfigurement and suggest the transplants

could prove longlasting without major problems.Despite the tissue rejection in the first year after their

transplants,neither men had psychological problems accepting their new faces and have been able to

rejoin society,they reported.

     Only three people have received face transplants.The world's first was carried out on French

woman Isabelle Dinoire in November 2005 after she was disfigured in an attack by her dog.In 2007,

her doctors reported that she had recovered slowly and steadily,overcoming two periods of rejection.

     In 2006,Chinese doctors performed a face transplant on a 30yearold hit by a bear.While there

were some complications with tissue rejection following the operation,two years later the man was

doing well,his doctors said."This case suggests that facial transplantation might be an option for

restoring a severely disfigured face,and could enable patients to bring themselves back into society,"

Shuzhong Guo and colleagues at Xijing Hospital in China wrote.

     A French team described their work on a 29yearold man who suffered from Von Recklinghausen

disease,an illness that changes the shape of his face."The man,who was not named,was given a new

nose,mouth and chin in a 2007 operation.He began to work 13 months after the transplant has more

function in his face and has not rejected the new tissue," his doctors said.

     "Our case confirms that face transplantation is practical and effective for the correction of specific

disfigurement," Dr.Laurent Lantieri and colleagues at the HenriMondor hospital outside Paris wrote.

1.What's the main idea of this passage?

A.Face transplants can work.

B.Face transplants help regain confidence.

C.Three people have received face transplants.

D.Disfigured people need face transplants.

2.What happened to the Chinese patient mentioned in the passage?

A.He got a strange illness when he was young.

B.He received several operations in hospital.

C.He was the first person to receive a face transplant.

D.He was once attacked by an animal.

3.From the passage we can learn that ________.

A.doctors have different opinions on facial disfigurement

B.patients could regain selfconfidence after face transplants

C.the new face of every patient has more functions than expected

D.it is easy for disabled people to be accepted by society

4.The underlined word "restoring" in Paragraph 4 means "________".

A.removing  

B.recovering

C.repairing  

D.rejecting

5.What problem resulted from the facial operations?

A.The patients wouldn't accept the facial change.

B.It was hard for the patients to get along with others.

C.It took some time for the patients to recover from the operation.

D.The patients usually suffered from tissue rejection.

单项选择题