首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
对于如下C语言程序 void*th_f (void*arg) { pfintf(“Hello World”); pthread_exit(0); } int main(void) { pthread_t ti
对于如下C语言程序 void*th_f (void*arg) { pfintf(“Hello World”); pthread_exit(0); } int main(void) { pthread_t ti
admin
2021-03-19
22
问题
对于如下C语言程序
void*th_f (void*arg)
{
pfintf(“Hello World”);
pthread_exit(0);
}
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);
}
在上述程序中,pthread_create函数表示( )。
选项
A、创建线程,线程名为th_f
B、创建线程,线程名为tid
C、创建线程,线程名为st
D、创建线程,线程名为NULL
答案
A
解析
pthread-create函数的作用是创建线程,包括有4个参数:第一个参数为指向线程标识符的指针;第2个参数用来设置线程属性;第3个参数是线程入口函数的起始地址。最后一个参数是入口函数的参数。一般以线程运行函数名来命名线程名,但线程标识信息放在tid里。故本题答案选择A选项。
转载请注明原文地址:https://kaotiyun.com/show/CK8Z777K
本试题收录于:
四级网络工程师题库NCRE全国计算机四级分类
0
四级网络工程师
NCRE全国计算机四级
相关试题推荐
下面所述步骤中,不是创建进程所必需的步骤是
某二叉树的后序序列为B,D,C,A,F,G,E,对称序序列为A,B,C,D,E,F,G,则该二叉树的前序序列为
下列协议不属于TCP/IP协议簇的是()。
在IEEE802.4标准中,TokenBus网从物理上看它是一个()的局域网。
TCP使用的流量控制协议是()。
某机器运行用MIPS指令编写的某程序需要26秒钟,该程序中每一类指令执行的次数如下;Add,sub,mul,div43000000add.d,sub.d,mul.d,div.d
下面的叙述中哪个是错误的?()
概念结构设计是整个数据库设计的关键,独立于数据库的逻辑结构,独立支持数据库的DBMS,其目标是产生反映企业组织信息需求的数据库概念结构,即概念模型。目前表达概念设计的工具有多种,其中最著名、最实用的是1976年提出的“E-R模型”。试回答以下问题;(
经验表明,在程序测试中,某模块与其他模块相比,若该模块已发现并改正的错误数目较多,则该模块中残存的错误数目与其他模块相比,通常应该______。
——可以用于数字签名。
随机试题
A注册会计师负责审计甲公司2012年财务报表。下列情形中,可能表明A注册会计师没有义务实施的程序是()。
钻孔、扩孔与车孔一般作为孔的粗加工和半精加工。()
酶联免疫吸附实验(ELISA)是输血相关传染病检测的常规方法,以下有关其基本原理的表述中错误的是
关于股骨的描述,错误的是
采用轴线法测设建筑方格网时,短轴线根据长轴线定向,其直角偏差应在()以内。
工程发包时,招标人应当依据相关工程的工期定额合理计算工期,压缩的丁期天数不得超过定额工期的一定百分比,超过者,应在招标文件中明示增加赶工费用,该百分比是()。
全国有些省市中考的文科综合科目,采用开卷形式进行。开卷考试时,学生记忆活动主要是()。
宏观经济管理的基本目标是()。
工作轮换
PlagiarismLinesBlurforStudentsinDigitalAgeAtRhodeIslandCollege,afreshmancopiedandpastedfromaWebsite’sfr
最新回复
(
0
)