首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下C语言程序。 void * th_f(void * arg) {printf("Ni Hao"); pthread_exit(0);} int main(void) { pthread_t tid; i
有如下C语言程序。 void * th_f(void * arg) {printf("Ni Hao"); pthread_exit(0);} int main(void) { pthread_t tid; i
admin
2022-06-20
27
问题
有如下C语言程序。
void * th_f(void * arg)
{printf("Ni Hao");
pthread_exit(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运行后进入等待态
D、线程th_f运行后主动释放CPU给其他线程
答案
B
解析
pthread_create(&tid,NULL,tn_f,NULL)创建线程后,运行该线程。th_f线程中调用了pthread_exit(0),线程th_f运行后主动退出。因此,本题答案选择B选项。
转载请注明原文地址:https://kaotiyun.com/show/dhyZ777K
本试题收录于:
四级网络工程师题库NCRE全国计算机四级分类
0
四级网络工程师
NCRE全国计算机四级
相关试题推荐
下列关于逻辑覆盖的叙述,说法错误的是______。
论述题3:针对以下C语言程序,请按要求回答问题下面是一个程序段(C语言),试设计基本路径测试的测试用例,设计出的测试用例要保证每一个基本独立路径至少要执行一次。函数说明:当iflag=0;返回icount+100当iflag=l;返回icou
以下关于面向对象程序集成测试的说法中,错误的是______。
已知C源程序如下:/**************************************************//*功能:检查输入的标识符是否符合C语言规则*//**************************
以下有关测试活动的描述中,错误的是A)测试策划中的活动是确定测试范围、测试环境和制定测试计划B)测试用例设计是测试设计与实现的主要内容C)测试执行中可随时修订测试计划D)测试总结的目的是对测试结果进行分析,以确定软件产品质量的当前状态
不需要运行程序,通过收集有关代码的结构信息来对程序进行的测试的是______。A)性能测试B)黑盒测试C)白盒测试D)静态分析
在代码检查中,负责提供关于检查项目的资料并回答检查人员问题的角色是______。A)协调人B)开发人员C)检查人员D)讲解员
关于内置式合约测试(BICT),下列说法错误的是______。A)增加了测试器构件和测试处理器构件,使被测构件具有自测试能力B)该测试方法可用于动态、分布式系统C)该测试方法的提出扩展了基于构件的软件工程实践D)提出的模型驱动方法效率很高
下面各项中,哪些是新一代数据库开发工具应有的特征?______。①支持开发人员对各种数据对象(字符、数字、图形、声音等)的处理②支持基于Internet应用的设计③支持面向对象的程序设计
下列对IEEE802.11b无线局域网的多蜂窝漫游工作方式的描述中,错误的是______。
随机试题
实脾散的功用是
患者男性,36岁,慢性肾炎多年,近来出现恶心,呕吐,呼吸深而快,血尿素氮20mmol/L(55mg/d1)、肌酐450μmol/L(5mg/d1),血pH7.25,血HCO3-20mmol/L,该患者的肾功能处于
根据《企业所得税法》规定,企业纳税年度发生的亏损,准予向以后年度结转,用以后年度的所得弥补,但结转年限最长不得超过()。
简述幼儿园以游戏为基本活动的依据。
子曰:“敏而好学,不耻下问”,反映的学习动机是()
某公司在一次招聘中,对所有申请者进行了一次书面测试,其中包括这样一个问题:“你是否是一个诚实的人?”有五分之二的申请者的回答是:“我至少有一点不诚实。”该公司在这次测试中,很可能低估申请者中不诚实的人所占的比例,因为以下哪项作为上文的后续最为恰当?
两次鸦片战争的相同之处是______。
刘芳是天润公司财务部的会计,她的主要工作是对公司员工的工资进行统计分析。为了高效率地做好本职工作,她使用Excel编制了员工工资表。请根据考生文件夹下“Excel素材文件.xlsx”中的内容,帮助她完成员工工资表的整理和分析工作。具体要求如下:将“基础
A、 B、 C、 C
SpeakerA:Ihaven’tseenyouforages.Youhaven’tbeensick,haveyou?SpeakerB:______
最新回复
(
0
)