首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下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
29
问题
有如下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://jikaoti.com/ti/sOl7FFFM
本试题收录于:
四级网络工程师题库NCRE全国计算机四级分类
0
四级网络工程师
NCRE全国计算机四级
相关试题推荐
以下哪种软件测试不属于软件性能测试的范畴______。
下列测试类型中,不是针对软件产品的质量特性的是______。A)性能测试B)安全性测试C)易用性测试D)回归测试
下列关于软件性能测试的说法中,正确的是______。A)性能测试的目的不是为了发现软件缺陷B)压力测试与负载测试的目的都是为了探测软件在满足预定性能需求的情况下所能负担的最大压力C)性能测试通常要对测试结果进行分析才能获得测试结论D)在性能
关于系统测试和配置项测试,下列说法错误的是______。A)两者的测试过程都是由独立于软件开发人员实施B)两者的测试过程都是由软件的供方组织C)两者的测试工作都满足对需要固化的软件提供固件D)两者都可以委托国家认可的第三方测试机构来实施
整体的项目计划框架,需求规格说明,技术知识和业务知识,标准环境,设计文档,足够的资源,人员的组织结构应当是______所包含的内容。A)测试计划的整体目标B)测试项目输入标准C)测试项目输出标准D)测试实施策略
下列属于基于性能计数器的分析技术的是A)指针分析B)进程分析C)数据流分析D)时间序列分析
在单元测试时,用于代替被调用模块的是A)桩模块B)代理模块C)驱动模块D)通信模块
发生的可能性小,但破坏性最大,可能导致物理存储设备损坏,使数据库文件及数据全部丢失的故障类型是——。
在SQLSetvet2000中,通过构建永久备份设备可以对数据库进行备份,下列说法正确的是______。
A、 B、 C、 D、 C默认情况下WindowsServer2003系统没有安装IIS组件。若要架构Web站点,需要在控制面板的[添加/删除程序]对话框中选择[添加/删除Windows组件]选项,接着双
随机试题
某兽药企业擅自销售被查封的兽药,对该违法行为应当给予的行政处罚是()
自然食品公司是早餐麦片和果汁市场的第二大公司。过去五年里,自然食品公司的利润额超过了行业平均水平,管理层决定实施增长方案。公司正在评估两个前景不错的机会。第一个机会是进入能低脂麦片市场。该项目需要新建或扩建生产设施以开发新产品,并在未来两年里通过
根据企业破产法律制度的规定,人民法院决定受理破产申请后,应自裁定受理破产申请之日起()内通知已知债权人,并予以公告。
关于我国公司资本制度特点的描述不正确的是()。
会前常见的人员是()。
遵义会议在中国共产党历史上的功绩主要体现为()
下面关于交换机的说法中,正确的是__________。(2010年下半年试题)
有以下程序:#include<stdio.h>#include<string.h>main(){charstr[][20]={’’One*World’’,’’One*Dream!’’},*p=str[1];
下列有关继承和派生的表述中,正确的是
【B1】【B2】
最新回复
(
0
)