问题 问答题

A、B两个程序,程序A按顺序使用CPU 10s,使用设备甲5s,使用CPU 5s,使用设备乙5s,最后使用CPU 10s。程序B按顺序使用设备甲10s,使用CPU 10s,使用设备乙5s,使用CPU 5s,使用设备乙10s。试问: a.在顺序环境下执行程序A和程序B,CPU的利用率是多少 b.在多道程序环境下,CPU的利用率是多少

答案

参考答案:

解析:a.程序A和程序B顺序执行时,程序A执行完毕,程序B才开始执行。两个程序共耗时80s,其中占用CPU的时间为40s,因此顺序执行时CPU的利用率为50%。
b.在多道程序环境下,两个程序并发执行,其执行情况如表1-1所示。可以看出,两个程序共耗时45s,其中占用CPU时间为40s,故此时CPU的利用率为40/45=88.89%。
                      表1—1 在多道程序环境下A、B执行示意图

CPU程序A程序9程序A程序D空闲程序A
程序ACPU设备甲等待CPU设备乙 CPU
程序B设备甲CPU设备乙CPU等待设备乙

判断题
单项选择题

Ask someone what they have done to help the environment recently and they will almost certainly mention recycling. Recycling in the home is very important of course. However, being forced to recycle often means we already have more material than we need. We are dealing with the results of that overconsumption in the greenest way possible, but it would be far better if we did not need to bring so much material home in the first place.
The total amount of packaging increased by 12% between 1999 and 2005. It now makes up a third of a typical household’s waste in the UK. In many supermarkets nowadays food items are packaged twice with plastic and cardboard.
Too much packaging is doing serious damage to the environment. The UK, for example, is running out of it for carrying this unnecessary waste. If such packaging is burnt, it gives off greenhouse gases which go on to cause the greenhouse effect. Recycling helps, but the process itself uses energy. The solution is not to produce such items in the first place. Food waste is a serious problem, too. Too many supermarkets encourage customers to buy more than they need. However, a few of them are coming round to the idea that this cannot continue, encouraging customers to reuse their plastic bags, for example.
But this is not just about supermarkets. It is about all of us. We have learned to associate packaging with quality. We have learned to think that something unpackaged is of poor quality. This is especially true of food. But it is also applied to a wide range of consumer products, which often have far more packaging than necessary.
There are signs of hope. As more Of us recycle, we are beginning to realize just how much unnecessary materials are collecting. We need to face the wastefulness of our consumer culture, but we have a mountain to climb.

What does the underlined phrase"over-consumption’refer to

A. Using too much packaging.
B. Recycling too many wastes.
C. Making more products than necessary.
D. Having more material than is needed.