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

外贸网站建设商家网页的建设

外贸网站建设商家,网页的建设,沈阳网站关键字优化,wordpress 卡密注册在下面的代码片段中#xff0c;我创建了6个线程。各有不同的优先级。全局优先级数组中提到了优先级。我正在根据线索索引在每个线程内连续增加全局变量。如果线程优先级更高#xff0c;我期待计数更高。但我的输出不遵循优先概念pl。请参阅下面显示的输出顺序。我在Ubuntu 16…在下面的代码片段中我创建了6个线程。各有不同的优先级。全局优先级数组中提到了优先级。我正在根据线索索引在每个线程内连续增加全局变量。如果线程优先级更高我期待计数更高。但我的输出不遵循优先概念pl。请参阅下面显示的输出顺序。我在Ubuntu 16.04和Linux内核4.10上尝试了这一点。Linux线程优先级行为不正常O/P,Thread0Thread3Thread2Thread5Thread1Thread4pid32155 count4522138740pid32155 count4509082289pid32155 count4535088439pid32155 count4517943246pid32155 count4522643905pid32155 count4519640181代码#include #include #define FAILURE -1#define MAX_THREADS 15long int global_count[MAX_THREADS];/* priority of each thread */long int priority[]{1,20,40,60,80,99};void clearGlobalCounts(){int i0;for(i0;iglobal_count[i]0;}/**thread parameter is thread index**/void funcDoNothing(void *threadArgument){int count0;int index *((int *)threadArgument);printf(Thread%d\n,index);clearGlobalCounts();while(1){count;if(count100){global_count[index];count0;}}}int main(){int i0;for(int i0;icreate_thread(funcDoNothing, i,priority[i]);sleep(3600);for(i0;i{printf(pid%d count%ld\n,getpid(),global_count[i]);}}create_thread(void *func,int thread_index,int priority){pthread_attr_t attr;struct sched_param schedParam;void *pParmNULL;int id;int * index malloc(sizeof(int));*index thread_index;void *res;/* Initialize the thread attributes */if (pthread_attr_init(attr)){printf(Failed to initialize thread attrs\n);return FAILURE;}if(pthread_attr_setschedpolicy(attr, SCHED_FIFO)){printf(Failed to pthread_attr_setschedpolicy\n);return FAILURE;}if (pthread_attr_setschedpolicy(attr, SCHED_FIFO)){printf(Failed to setschedpolicy\n);return FAILURE;}/* Set the capture thread priority */pthread_attr_getschedparam(attr, schedParam);;schedParam.sched_priority sched_get_priority_max(SCHED_FIFO) - 1;schedParam.sched_priority priority;if (pthread_attr_setschedparam(attr, schedParam)){printf(Failed to setschedparam\n);return FAILURE;}pthread_create(id, attr, (void *)func, index);}
http://www.sadfv.cn/news/170063/

相关文章:

  • 公司网站怎么登录宁波住房和城乡建设网站
  • 安庆网站建设工作室个人可以建论坛网站吗
  • 专业的网站建设公司哪家好英文网站一般用什么字体
  • 南京微信网站开发网络舆情分析报告范文
  • 网站建设先有域名然后呢杭州seo关键词优化哪家好
  • 如何做网站的页面营销神器官方网站
  • 视频网站会员系统怎么做西安成品网站建设
  • 相亲网站上做绿叶的女人很多公司设计网站推荐
  • 朱晓宇 大庆 seo 网站建设 北京建网站一般多少钱幸福里
  • 肇庆免费模板建站产品推广朋友圈文案
  • 西安网络公司未央区昆明网站排名优化
  • 网站后台上传文章为什么不显示sem和seo有什么区别
  • 在线制作二维码网站ico网站进行推广
  • 杭州网站建设外包天津最好的网站建设
  • 自己怎么做网站赚钱吗tp框架做展示网站
  • 广告推广平台网站wordpress做知识管理系统
  • 帮人做网站 怎么收费xampp 搭建 wordpress
  • 网站建设流程怎么样文案写作网站
  • 企业网站建设训重庆航运建设发展有限公司 网站
  • 网站建设完整版企业管理系统的功能
  • app在线开发网站建设抖音小程序推广码怎么获得
  • 国内设计师交流网站上海松江水处理网站建设
  • 西安品牌网站建设服务商建设网站基础知识
  • 织梦 网站源码重庆网站建设重庆
  • 模板网站和定制网站影响排名html个人网站完整代码
  • 百度为什么会k网站线上推广话术
  • 加强单位门户网站建设的通知docker wordpress 修改端口
  • 网站开发怎么销售百度关键词指数
  • 男女做暧昧视频网站成都中职学校网站建设推广
  • idea做百度网站谷歌浏览器下载手机版官网中文