⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 schedtest.c

📁 The main purpose of this project is to add a new scheduling algorithm to GeekOS and to implement a s
💻 C
字号:
#include <conio.h>#include <process.h>#include <sched.h>#include <sema.h>#include <string.h>#if !defined (NULL)#define NULL 0#endifint main(int argc , char ** argv){  int policy = -1;  int quantum;  int id1, id2, id3;    	/* ID of child process */  if (argc == 3) {    if (!strcmp(argv[1], "rr")) {      policy = 0;    } else if (!strcmp(argv[1], "mlf")) {      policy = 1;    } else {      Print("usage: %s [rr|mlf] <quantum>\n", argv[0]);      Exit(1);    }    quantum = atoi(argv[2]);    Set_Scheduling_Policy(policy, quantum);  } else {    Print("usage: %s [rr|mlf] <quantum>\n", argv[0]);    Exit(1);  }  quantum = atoi(argv[2]);  Set_Scheduling_Policy(policy, quantum);  id3 = Spawn_Program ( "/c/sched3.exe", "/c/sched3.exe") ;  id1 = Spawn_Program ( "/c/sched1.exe", "/c/sched1.exe") ;  id2 = Spawn_Program ( "/c/sched2.exe", "/c/sched2.exe") ;    Wait(id1);  Wait(id2);  Wait(id3);  Print("\n");  return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -