首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下C语言程序 void*th_f(void*arg) { printf(“Hello World”); } int main(void) { pthread_t tid: int st: st=pthread_cre
有如下C语言程序 void*th_f(void*arg) { printf(“Hello World”); } int main(void) { pthread_t tid: int st: st=pthread_cre
admin
2021-03-19
24
问题
有如下C语言程序
void*th_f(void*arg)
{
printf(“Hello World”);
}
int main(void)
{
pthread_t tid:
int st:
st=pthread_create(&tid,NULL,th_f,NULL);
if(st==0)
printf(“Oops,I can not createthread\n”);
exit(NULL);
针对上述程序,下列叙述中哪一个是正确的?( )
选项
A、线程th_f运行中出现错误
B、线程th_f运行后等待一个特定的线程退出
C、线程th_f运行后主动释放CPU给其他线程
D、线程th_f运行后退出
答案
D
解析
pthread_create(&rid,NULL,th_f,NULL)创建线程后,运行该线程。只有一个printf函数调用语句,所以线程会执行完指令后退出,线程tn_f运行后主动退出。故本题答案选择D选项。
转载请注明原文地址:https://kaotiyun.com/show/osyZ777K
本试题收录于:
四级网络工程师题库NCRE全国计算机四级分类
0
四级网络工程师
NCRE全国计算机四级
相关试题推荐
计算机网络按覆盖的地理范围,可以分为()。
下列哪一个测试程序是复合基准程序()。
(1)指令的控制方式有几种?优缺点各是什么?(2)如何评价流水线的性能?(3)一台非流水线机器执行指令时共分五步,所需时间分别为40ns、40ns、50ns、40ns和40ns。若采用流水线工作方式,并且由于锁存器而附加了20ns的延迟,那么该流水线
若二叉树前序周游访问结点顺序为ABCDEFG,中序周游访问结点顺序为CBDAFGE,则其后序周游访问结点顺序为()。
若用如下的SQL语句创建了一个表SC:CREATETABLESC(S#CHAR(6)NOTNULL,C#CHAR(3)NOTNULLSCOREINTEGER,NOTECHAR(20))今向SC表插入如下行时,(
在下列各种类型的I/O技术中,对CPU依赖最小的是
在软件结构中,模块可以分为几类,以下哪种不属于模块划分的固有类型?
下面有关渐增式集成和非渐增式集成测试的说法中错误的是______。
下列关于软件质量模型的说法中正确的是______。
在某DHCP客户端上捕获了6个IP报文如表2-4所示。表2-4中第5条报文的相关解析如图2-5所示。请分析相关信息并回答下列问题。(1)客户端获得的IP地址是(11)。(2)在DHCP服务器中设置的DNS服务器地址是(12),路由器
随机试题
简述Flash动画设计软件的工作环境。
意识清醒的病人角膜反射消失,损伤可能在【】
解剖雌雄按蚊的涎腺,逸出子孢子的形态为
引起厥证的常见病因有
下列关于简易程序与一审普通程序的说法不正确的是()。
关于不作为犯,下列说法正确的是?
根据《首次公开发行股票承销业务规范》,下列关于首次公开发行股票配售结果的说法,正确的有()。[2017年9月真题]Ⅰ.对公募养老社保类配售对象的配售数量不得低于其他类配售对象Ⅱ.对公募养老社保类配售对象的配售比例不低于网下发行股票数
根据国际会计准则委员会(IASC)国际会计准则第39号(《金融工具:确认与计量》)文件对金融洐生工具的定义,以下不属于金融衍生工具特征的是()
使用VC6打开考生文件夹下的源程序文件modi3.cpp。其中定义的类并不完整,按要求完成下列操作,将类的定义补充完整。完成以下功能:(1)定义类的私有变量a、b,请在注释//********1********后添加适当的语句。(2)完
Nowadaysthescatteringofgalaxiesandtheastoundingabundanceofstarsareforcingthosewhopondersuchmatterstoafurther
最新回复
(
0
)