首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下C语言程序。 void * th_f(void * arg) { printf("Ni Hao"); pthread_yiled(0); } int main(void) { pthread_t tid; int at
有如下C语言程序。 void * th_f(void * arg) { printf("Ni Hao"); pthread_yiled(0); } int main(void) { pthread_t tid; int at
admin
2022-06-21
24
问题
有如下C语言程序。
void * th_f(void * arg)
{ printf("Ni Hao");
pthread_yiled(0);
}
int main(void)
{
pthread_t tid;
int at;
at==pthread_create(&tid,NULL,th_f,NULL);
if(at==0)
printf("I can not create thread\n");
exit(NuLL);}
针对以上程序,下列叙述中正确的是( )。
选项
A、线程th_f运行后主动退出
B、线程th_f运行后等待一个特定的线程退出
C、线程th_f运行后主动释放CPU给其他线程
D、线程th_f运行后成为僵尸
答案
C
解析
pthread_create(&tid,NULL,th_f,NULL):创建线程后,运行该线程,th_f线程中调用了pthread_yield(0)。线程th_f运行后等待该线程退出后挂起自己,将CPU让给其他线程。因此,本题答案选择C选项。
转载请注明原文地址:https://kaotiyun.com/show/rXyZ777K
本试题收录于:
四级网络工程师题库NCRE全国计算机四级分类
0
四级网络工程师
NCRE全国计算机四级
相关试题推荐
关于对软件测试定义的理解,下边哪句话是正确的______。A)应用系统开发完毕,再对它进行测试B)软件开发中产生的错误都源于编码阶段的错误代码C)测试是我们考察并理解与发布的软件系统有关的利益和风险状况的过程D)完备的测试能够详尽地表明软件
静态分析中,提供整个项目中的所有函数之间的调用关系图属于______。A)程序结构分析B)程序数据流分析C)可视化分析D)程序执行频度分析
在软件设计阶段,测试的对象来自设计文档,包括外部设计的规格说明、内部设计的规格说明、逻辑设计的规格说明,对文档的测试主要采用的测试方法为______。A)走查B)调用测试用例进行测试C)评审D)静态测试
以下是教材购销系统的描述,请仔细阅读并按要求回答问题。某图书管理系统有以下功能:A.借书:输入读者借书证,系统首先检查借书证是否有效。然后检查该读者所借图书是否超过10本,若已达到,拒借;未达到10本,办理借书,修改库存并记录。B.还书:从借书
Web应用软件的安全性主要通过以下哪个手段实现______。A)安全管理控制B)接口检测C)漏洞扫描D)安全策略
不是软件测试评估的目的是______。A)量化测试过程,判定测试进行的状态B)决定什么时候测试可以结束C)保证每个阶段的测试任务得到执行D)为最后的测试或质量分析报告生成所需的量化数据
下列关于测试团队的说法中,不正确的是______。A)建立、组织和管理一支优秀的测试团队是做好软件测试工作的基础,也是最重要的工作之一B)测试团队的规模一般要非常的大,哪怕再小的软件测试小组也不能一个人C)测试人员的基本职责是发现系统的缺陷D
单元测试与系统测试的区别是A)单元测试采用白盒测试方法,系统测试采用黑盒测试方法B)在测试时间上,系统测试晚于单元测试C)单元测试从开发者角度考虑问题,而系统测试从用户角度考虑问题D)以上全部
在数据库物理设计阶段,建立索引的目的是为了提高数据的——。
在数据库镜像的两种模式中,两台主机均为工作机,并为信息系统提供支持的是(14)。一台主机为工作机,另一台为备份机的是(15)。15.
随机试题
A.光学法B.黏度法C.电流法D.透射比浊法和散射比浊法E.以上都是光学法包括
患者,男,30岁。患风湿性心脏病10年。平时一般活动时症状不明显。5天来明显心慌,稍事活动即感气短,不能平卧。心电涂示心房颤动,心室律完全不齐,140次/min。拟即刻静脉给药.首选的治疗药物是
低碳钢的含碳量应低于()。
()不属于旅游职业道德的特点。
导游在旅游团的行程中应起好组织者和协调人角色的作用。()
下列文学常识表述,错误的是:
根据我国宪法和有关法律的规定,下列构成违宪或违法的行为是()。
交管局要求司机在通过某特定路段时,在白天也要像晚上一样使用大灯,结果发现这条路上的年事故发生率比从前降低了15%。他们得出结论说:如果在全市范围内都推行该项规定会同样地降低事故发生率。以下哪项如果为真,最能支持上述论证的结论?
近代中国最革命的阶级是()
X和Y为两个逻辑变量,设X=10111001,Y=11110011,对两个逻辑变量进行逻辑与运算的结果是( )
最新回复
(
0
)