xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

資源簡介

進程管理 執行 喚醒 阻塞 結束

資源截圖

代碼片段和文件信息

#include
#include
void?Instruction();
typedef?struct?node
{
int?data;
struct?node?*next;
}linklist;
linklist?*head;
typedef?struct?node1
{
int?data;
struct?node1?*next;
}dlinklist;
dlinklist?*head1;
int?j?=?0;
void?CreatePCB()//創建PCB
{
linklist?*r;
r?=?head;
while(r->next?!=?NULL)
r?=?r->next;
if(r->next?==?NULL&&?j?!=?11)
{
int?x;
linklist?*p;
printf(“請輸入進程名\n“);
scanf(“%d“&x);
p?=?(linklist*)malloc(sizeof(linklist));
p->data?=?x;
r->next?=?p;
r?=?p;
printf(“%d“p->data);
printf(“創建成功\n“);
j++;
}
????if(j?==?11)?
{
r->next?=?NULL;
printf(“進程已滿\n“);
getchar();
Instruction();
}
????else?if(head->next?!=?NULL)//head->next作為執行態
{
printf(“%d“head->next->data);
printf(“處于執行態\n“);
r->next?=?NULL;
getchar();
Instruction();
}
}
void?Block()
{
dlinklist?*t*r;
linklist?*q;
r?=?head1;
while(r->next!=NULL)
{
r=r->next;
}
if(head->next?!=?NULL)//有執行態就將執行態阻塞
{
t=(dlinklist*)malloc(sizeof(dlinklist));
t->data?=?head->next->data;
r->next?=?t;
r?=?t;
printf(“%d“t->data);
printf(“已處于阻塞態\n“);
q?=?head->next;
head->next?=?head->next->next;
free(q);
j--;

if(head->next?!=?NULL)
{
printf(“%d“head->next->data);
printf(“處于執行態\n“);
}
else
printf(“進程為空\n“);
}
else
{
printf(“錯誤操作\n“);
}
r->next?=?NULL;
getchar();
Instruction();
}
void?Wakeup()
{
int?x;
dlinklist?*t*s*m*w;
linklist?*p*q;
t?=?head1;
s?=?head1;
p?=?head;
if(head1->next?==?NULL)?printf(“沒有可喚醒的進程\n“);
else
{
printf(“請選擇喚醒進程\n“);
while(t->next?!=?NULL)//輸出阻塞態
{
printf(“%d????“t->next->data);
t?=?t->next;
}
t?=?head1;
scanf(“%d“&x);
while(t->next?!=?NULL)
{
if(x?==?t->next->data)
{
while(p->next?!=?NULL)//找到鏈表PCB的尾
p?=?p->next;
q?=?(linklist*)malloc(sizeof(linklist));
q->data?=t->next->data;
p->next?=?q;
p?=?q;
p->next=NULL;
printf(“%d“x);
printf(“喚醒成功\n“);
printf(“%d“head->next->data);
printf(“正在執行\n“);
j++;
w?=?t->next;//刪除多余項
m?=?head1;
while(m?!=?t)
m?=?m->next;
m->next?=?m->next->next;
free(w);
break;
}
els

評論

共有 條評論