Change_Scheduling_Policy
来源:互联网 发布:php二维数组排序函数 编辑:程序博客网 时间:2024/06/08 14:30
int Change_Scheduling_Policy(int policy,int quantum){ struct Kernel_Thread *thread,*ithread; int i; if(policy==0) { if(g_SchedPolicy==0)return 0; if(g_SchedPolicy==1){ for(i=1;i<MAX_QUEUE_LEVEL;++i) {thread=Get_Front_Of_Thread_Queue(&s_runQueue[i]); while(thread!=0){ ithread=Get_Next_In_Thread_Queue(thread); thread->currentReadyQueue=0; Remove_From_Thread_Queue(&s_runQueue[i],thread); Add_To_Back_Of_Thread_Queue(&s_runQueue[0],thread); thread=ithread;} } g_Quantum=quantum; g_SchedPolicy=0; } } if(policy==1){ if(g_SchedPolicy==0){ thread=Get_Front_Of_Thread_Queue(&s_runQueue[0]); while(thread!=0) {if(thread->priority==0)break; thread=Get_Next_In_Thread_Queue(thread); } thread->currentReadyQueue=3; Remove_From_Thread_Queue(&s_runQueue[0],thread); Add_To_Front_Of_Thread_Queue(&s_runQueue[3],thread); g_Quantum=quantum; g_SchedPolicy=1; } if(g_SchedPolicy==1)return 0; } return 0;}
阅读全文
0 0
- Change_Scheduling_Policy
- 月销量首破14万,7款车销量过万!吉利汽车11月销量141265辆
- 不寒而栗!一代大佬突然公布实情!谁也逃不掉!
- 全球100款大数据工具汇总(前50款)
- 交换机的telnet密码和特权模式密码
- Vue2.0缓存
- Change_Scheduling_Policy
- 邻接表 链式前向星
- 深入浅出学习mysql命令
- 支付宝用大数据憋死伪基站骗子
- 科技部公布首批国家新一代人工智能开放创新平台及战略咨询委员会名单(4家/27位)
- 大数据时代的10个重大变革
- SD卡存储
- 世界互联网大会公布了 18 项全球领先科技成果,10 项来自中国
- 在宽带无线系统中能量和信息同时传输