首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下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
26
问题
有如下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://jikaoti.com/ti/VKl7FFFM
本试题收录于:
四级网络工程师题库NCRE全国计算机四级分类
0
四级网络工程师
NCRE全国计算机四级
相关试题推荐
单元测试首先对通过模块接口的数据流进行测试。接口测试主要从如下几个方面考虑______。①模块的形参和其驱动模块送来的参数的个数、类型、次序是否一致②模块传送给被调用模块的参数与其桩模块的参数的个数、类型和次序是否一致③模块传送给库
以下哪种应用服务器不遵循J2EE规范______。A)Oracle9iApplicationServerB)PKUASC)WebLogicD)Tuxedo
针对软件对其运行环境的依赖进行测试,以验证软件是否能在所有期望的环境中运行,这种测试方法是______。A)极限测试B)易用性测试C)功能测试D)兼容性测试
下列四个选项中,不属于软件测试应该遵守的原则的是A)程序员应当参与测试自己的程序B)充分注意测试中的群集现象C)应当对每一个测试结果做全面检查D)测试用例应当由测试输入数据和与之对应的预期输出结果两部分组成
场景测试方法是基于IBM公司推行的RUP的测试用例生成方法,该方法的出发点是A)用例B)事件流C)控制流D)数据流
现有SQLSever2000数据库服务器,其中的一个数据库占用80GB空间,另有一台用于备份的计算机,该机上有四个大小均为50GB的硬盘分区。若要将此数据库完全备份到该计算机上,则______。
什么是封锁协议?不同级别的封锁协议的主要区别是什么?如何用封锁机制保证数据的一致性?
下面各项中,哪些是数据仓库的基本特征?——I.数据仓库是面向主题的Ⅱ.数据仓库的数据是集成的Ⅲ.数据仓库的数据是相对稳定的Ⅳ.数据仓库的数据是反映历史变化的
实际的数据库管理系统产品在体系结构上通常具有的相同的特征是______。
以下哪个协议架构是SIMPLE的基础?()
随机试题
Hadheworkedharder,he______theexams.
正常情况下,血管的解剖位置和血流动力学指标都有个体差异,无绝对的指标,必须根据
Rh溶血病诊断的确诊依据是
某项队列研究得出的相对危险度为5.0,95%的可信限为3.2~6.0,下列哪种说法不正确
职业道德是同人们()紧密相连的,具有自身职业特征的道德准则,职业行为规范的总和。
国家对出口食品及其生产企业(包括加工厂、屠宰场、冷库、仓库等)实施( )登记制度。
2013年3月31日,甲公司采用出包方式对某固定资产进行改良,该固定资产账面原价为3600万元,预计使用年限为5年,已使用3年,预计净残值为零,采用年限平均法计提折旧。甲公司改良过程中支付出包工程款96万元。2013年8月31日,改良工程完工,固定资产达到
2006年至2011年全年我国农村居民人均纯收入分别为3587元、4140元、4761元、5153元、5919元、6977元;城镇居民人均可支配收入分别为11759元、13786元、15781元、17175元、19109元、2181
Someconsumerresearchersdistinguish【C1】______"rational"motivesand"emotional"(or"non-rational"motives.Theyusetheterm
TheCurieshadhopedthattheNobelPrizewouldfinallybringtheopportunityforachairattheFrenchAcademyandthelaborato
最新回复
(
0
)