问题 单项选择题

当一个应用程序的所有非守护线程终止运行时,但仍然有守护线程在运行,应用程序将

A.运行

B.阻塞

C.终止

D.休眠

答案

参考答案:C

解析:本题考查线程的机制。守护线程是一类特殊的线程,它和普通线程的区别在于它并不是应用程序的核心部分,当一个应用程序的所有非守护线程终止运行时,即使仍然有守护线程在运行,应用程序也将终止;反之,只要有一个非守护线程在运行,应用程序就不会终止。守护线程一般被用于在后台为其他线程提供服务。可以通过调用方法isDaemon()来判断一个线程是否是守护线程,也可以调用方法 setDaemon()来将一个线程设为守护线程。

单项选择题
单项选择题

Passage Three

Imagine eating everything delicious you want with none of the fat. That would be great, wouldn’t it
New "fake fat" products appeared on store shelves in the United States recently, but not everyone is happy about it. Makers of the products, which contain a compound called olestra, say food manufacturers can now eliminate fat from certain foods. Critics, however, say the new compound can rob the body of essential vitamins and nutrients and also cause unpleasant side effects in some people. So it’s up to consumers to decide whether the new fat-free products taste good enough to keep eating.
Chemists discovered olestra in the late 1960s, when they were searching for a fat that could be digested by infants more easily. Instead of finding the desired fat, the researchers created a fat that can’t be digested at all.
Normally, special chemicals in the intestines (肠道) "grab" molecules of regular fat and break "them down so they can be used by the body. A molecule of regular fat is made up of three molecules of substances called fatty acids.
The fatty acids are absorbed by the intestines and bring with them the essential vitamins A, D, E and K. When fat molecules are present in the intestines with any of those vitamins, the vitamins attach to the molecules and are carried into the bloodstream.
Olestra, which is made from six to eight molecules of fatty acids, is too large for the intestines to absorb. It just slides through the intestines without being broken down. Manufacturers say it’s that ability to slide unchanged through the intestines that makes olestra so valuable as a fit substitute. It provides consumers with the taste of regular fat without any bad effects on the body. But critics say olestra can prevent vitamins A, D, E and K from being absorbed. It can also prevent the absorption of carotenoids (类胡萝卜素), compounds that may reduce the risk of cancer, heart disease, etc.
Manufacturers are adding vitamins A, D, E and K as well as carotenoids to their products now. Even so, some nutritionists are still concerned that people might eat unlimited amounts of food made with the fat substitute without worrying about how many calories they are consuming.

We learn from the passage that olestra is a substance that ______.

A.contains plenty of nutrients

B.makes foods fat-free while keeping them delicious

C.renders foods calorie-free while retaining their vitamins

D.makes food easily digestible