问题 问答题

一个系统具有150个存储单元,在T0时刻系统按下表所示分配给3个进程。

进程最大需求已分配
P17025
P26040
P36045
对下列请求应用银行家算法分别分析判定是否安全

第4个进程P4到达,最大需求60个存储单元,当前请求分配25个单元。

答案

参考答案:

解析:P4的当前请求量request4为25,小于它的最大需求量60和Available(40)。故可为它试行分配资源,分配后的新状态如下表所示:

进程NeedAllocationAvailable
P1452515
P22040
P31545
P43525
对上述状态进行安全性检查,此时,能找到一个安全序列<P3,P4,P1,P2>,系统处于安全状态,故可为P4分配资源。

单项选择题
填空题

Seasick Try Controlling Your Breathing


If you get seasick easily, you may prepare for boat rides with pressure-point bracelets, ginger, or a prescription skin patch. (1) The technique presumably works because it helps control gravity sensors in the abdomen-a lesser-known input to our fine-tuned balance system.
(2) The inner ears sense motions of the head; the eyes see where the head is; and tiny sensory organs in muscles and tendons sense where the rest of the body is. More recently, researchers have realized that sensors in many other parts of the body also play a role: in the abdomen, the lower organs, and even blood vessels. (3) But if one or two don’t match up, the brain gets confused and we become nauseated.
Scientists knew the most sickening motions closely match the rate of natural breathing; they also knew that people naturally tend to breathe in time with a motion. (4)
Researchers from Imperial College London enlisted 26 volunteers to sit in a tilting, rocking flight simulator and coordinate their breathing in various ways with the motion. (5) The natural tendency was for volunteers to inhale on every backward tilt, in rhythm with the rocking. (6) They felt even better if they breathed slightly faster or slower than the cyclic heaving of the chair; using that technique, the time until onset of nausea was 50% longer than during normal breathing.
(7) Abdominal sensors are known to send motion signals to the brain more slowly than those in the inner ear because they’re farther away from the brain and because abdominal organs have more mass, which means they resist movement a tiny bit longer. (8) But if the diaphragm opposes gravity-induced stomach motions with controlled breaths, there is less sensory conflict and less nausea. "This technique is very good for mild everyday challenges," says medical research scientist Michael Gresty, a member of the study team. "it’s completely safe, and it’s not a drug."
A. But if the subjects exhaled on every backward tilt, they didn’t get sick as quickly.
B. As long as all of these sensors send matching signals to the brain, we feel oriented.
C. Now there’s one more remedy: timing your breathing to counteract the nauseating motion.
D. So why do these tactics work
E. The brain is traditionally thought to sense body position in three ways.
F. The time lag between the two types of sensors creates a mismatch that builds up in the brain and makes us gradually sicker, the researchers say.
G. The tests lasted up to 30 minutes, or until subjects felt moderately sick.
H. But no one had ever tested whether breathing out of time with a motion could prevent nausea.