ĵ - רҵдķϷվ
ҳ > ѧ >  > 800 >

操作系统进程调度编程 - 百度文库

ʱ䣺 ղ ҪͶ

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ʽ

ѡͼ

7203p63mq76b8ve00zsa83uyx967u500v8v
ȡ

΢ɨȡ

΢ɨ