当前位置: 首页 > news >正文

建立个人网站需要什么国外网站开发

建立个人网站需要什么,国外网站开发,广州网站建设全包,淘宝联盟怎么做自己的网站问题:编写程序完成如下功能:程序创建2个线程,然后: 1> 主线程先打印“I am main thread”,然后睡眠2秒后,打印"main thread wake up",主线程退出 2> 第一个新线程先打印“…

问题:编写程序完成如下功能:程序创建2个线程,然后:
        1> 主线程先打印“I am main thread”,然后睡眠2秒后,打印"main thread wake up",主线程退出
        2> 第一个新线程先打印“I am the first new thread”,然后睡眠3秒后,打印"the first new thread wake up",退出
        3> 第二个新线程先打印“I am the second new thread”,然后睡眠5秒后,打印"the fsecond new thread wake up",退出
    要求能看到所有打印信息



代码:

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <unistd.h>
#include <pthread.h>
#include <assert.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>void *fun1(){printf("I am the first new thread\n");sleep(3);printf("the first new thread wake up\n");return NULL;
}void *fun2(){printf("I am the second new thread\n");sleep(5);printf("the second new thread wake up\n");return NULL;
}int main(int argc,char *argv[]){pthread_t id[2];int ret = 0;ret = pthread_create(&id[0],NULL,fun1,NULL); // thread1ret += pthread_create(&id[1],NULL,fun2,NULL); // thread2if(ret){printf("pthread_create failed\n");return 1;}printf("I am main thread\n"); // main threadsleep(2);printf("main thread wake up\n");pthread_exit(NULL); // main thread exitpthread_join(id[0],NULL); // thread1 exitpthread_join(id[1],NULL); // thread2 exitreturn 0;
}

输出:

http://www.hkea.cn/news/248722/

相关文章:

  • 企业网站建设申请域名seo赚钱
  • 2017网站开发前景百度网盘资源链接入口
  • 平面广告设计主题seo是怎么优化上去
  • 正规网站制作公司哪家好四年级写一小段新闻
  • 济南网站建设安卓版快手seo
  • java开发兼职网站开发线上推广平台
  • 北京网站建设开发公司网站自动收录
  • wordpress最多多少用户seo基础知识
  • 湘潭做网站 去磐石网络b站推出的短视频app哪个好
  • 宿迁做网站的公司有人看片吗免费观看视频
  • 什么人最需要建设网站淘宝运营一般要学多久
  • 海南网站优化东莞免费建站公司
  • 传播型网站建设优势有哪些推广类软文
  • 如何在百度做网站推广赚钱的软件
  • c# 网站开发教程周口网站seo
  • 湘西网站建设帮人推广注册app的平台
  • 切图做网站web制作网站的模板
  • 网站的做网站公司哪家好网络优化大师app
  • 国内外包网站今日头条(官方版本)
  • 外网建筑设计网站线上渠道推广有哪些方式
  • 厦门做网站公司排名电工培训机构
  • 武汉网站设计制作外包公司的人好跳槽吗
  • 网站建设哪里最好页面关键词优化
  • 清远建设网站制作seo系统培训课程
  • 网站的网页建设知识ppt北大青鸟职业技术学院简介
  • 巫山网站设计aso优化榜单
  • 关于节约化建设网站的表态发言网站制作报价表
  • 建行网站是多少呢故事式的软文广告例子
  • 阳江市住房和城乡规划建设局网站一级消防工程师考试
  • 做课件的网站有哪些用html制作淘宝网页