1. ʵ
дһµĽ̵ȳģϵͳԽ̵ĵȡ
2. ʵĿ
DzϵͳҪĸ̵Dzϵͳĺģ顣ʵҪѧƲʵ̵ֽģԼԽ̿ƿ̵ֽ㷨⡣
3. ʵҪ
ɽ̣֧ȷҵȡʣʱȡʱƬת̬ȼ㷨̵ܹĵȹ̡
4. ʹõݽṹ˵
(1). PCB ̿ƿ飩
1. 2. 3. 4. 5. 6. 7. 8. 9.
struct pcb {
int id;
int arrive; int run;
int priority; int time; bool done; };
˵
ڽ̿ƿм¼Ϣ
˵ id int ̺pid arrive int ̵ʱ run int ʱ priority int ȼ time int еʱƬ done bool ¼ǷѾ (2). PCB
1. struct pcb process[N];
˵
processڱ漰Ľ̵Ϣ
5. ֵ㷨Ĵ̣ҪģϸƼܺͽӿ˵
(1). Ԥ
㷨
Ӧ뼰ע
1. int main() 2. {
3. // ʼPCB
4. memset(process, 0, sizeof(process)); 5. // 6. int type;
7. scanf(\,&type);
操作系统进程调度编程 - 百度文库
1.ʵݱдһµĽ̵ȳģϵͳԽ̵ĵȡ2.ʵĿĽDzϵͳҪĸ̵Dzϵͳĺģ顣ʵҪѧƲʵ̵ֽģԼԽ̿ƿ̵ֽ㷨⡣3.ʵҪɽ̣֧ȷҵ
Ƽȣ
ĵĵΪdocʽ