电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

自考操作系统上机

自考操作系统上机_第1页
1/36
自考操作系统上机_第2页
2/36
自考操作系统上机_第3页
3/36
北京自考吧(ZIKAOBA.COM) 北大操作系统(本)上机考试题总结(完整版) 布丁整理 1 一、进程调度 进程调度算法有 FIFO,优先数调度算法,时间片轮转调度算法,分级调度算法,目前主要是考FIFO和优先数调度算法(静态优先级)。 进程调度算法的数据结构主要有:进程 函数定义:建立进程函数,进程调度函数 一个网友做的一个 FIFO 调度算法的示例: #include "stdio.h" #define max 100 #define pfree 0 /*process end*/ #define running 1 /*process running status*/ #define aready 2 /*process aready status */ #define blocking 3 /*process aready blocking status*/ typedef struct node { char name; int status; int precendence; int ax,bx,cx,dx; int pc; int psw; struct node *next; /*pcb define*/ }pcb; pcb *createprocess(pcb *head) { pcb *p,*q; int a,b,c,d,m,n; char ID; int s; q=NULL; printf("\ninput the first seven status pcb:"); scanf("\n%c",&ID); scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&m,&n); while(ID!='*') { p=(pcb*)malloc(sizeof(pcb)); p->name=ID; p->ax=a; 北京自考吧(ZIKAOBA.COM) 北大操作系统(本)上机考试题总结(完整版) 布丁整理 2 p->bx=b; p->cx=c; p->dx=d; p->pc=m; p->psw=n; p->precendence=pre; p->status=aready; if(head==NULL) head=p; else q->next=p; q=p; printf("\ninput the next pcb: "); scanf("\n%c",&ID); scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&m,&n); } if(q!=NULL) q->next=NULL; q=head; while(q) { printf("\n peocess name. status.ax. bx. cx. dx. pc. psw.\n "); printf("%10c%5d%8d%5d%5d%5d%5d%5d%5d",q->name,q->status,q->precendence,q->ax,q->bx,q->cx,q->dx,q->pc,q->psw); q=q->next; } return head;/*createprocess end*/ } void processfifo(pcb *head) /*use fifo */ { pcb *p; p=head; printf("\n the process use fifo method.\n"); printf("running the frist process:\n"); while(p!=NULL) { p->status=running; printf("\nprocess name status. ax. bx. cx. dx. pc. psw."); printf("\n%10c%5d%8d%5d%5d%5d%5d%5d",p->name,p->status,p->ax,p->bx,p->cx,p->dx,p->pc,p->psw);...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

自考操作系统上机

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部