操作系统进程调度 第3页

       jiuxu[i].daxiao=m;

       jiuxu[i].pid=n;

       jiuxu[i].youxian=t;

}

 

void huanchub()

{

       int i,p;

       printf("\n请输入想要挂起的进程的PID:\n(在以下中选:");

       for(i=0;i<NUM1;i++)

       {

              printf("%d ",jiuxu[i].pid);

       }

       printf(")\n");

       scanf("%d",&p);

       for(i=0;i<NUM1;i++)

       {

              if(p==jiuxu[i].pid)

              {

                     guaqi[NUM2].daxiao=jiuxu[i].daxiao;

                     guaqi[NUM2].pid=jiuxu[i].pid;

                     guaqi[NUM2].youxian=jiuxu[i].youxian;

                     NUM2++;

                     break;

              }

              else continue;

       }

       for(i;i<NUM1;i++)

       {

              jiuxu[i].daxiao=jiuxu[i+1].daxiao;

              jiuxu[i].pid=jiuxu[i+1].pid;

              jiuxu[i].youxian=jiuxu[i+1].youxian;

       }                  

       NUM1--;

}

void huanchuc()

{

       int i;

       jiuxu[NUM1].daxiao=guaqi[0].daxiao;

       jiuxu[NUM1].pid=guaqi[0].pid;

       jiuxu[NUM1].youxian=guaqi[0].youxian;

       NUM1++;

       for(i=0;i<NUM2;i++)

       {

              guaqi[i].daxiao=guaqi[i+1].daxiao;

              guaqi[i].pid=guaqi[i+1].pid;

              guaqi[i].youxian=guaqi[i+1].youxian;

       }

       NUM2--;

}

 

void huanchud()

{

       int i,p,m,n,t;

       printf("\n请输入想要运行的进程的PID:\n(在以下中选:");

       for(i=0;i<NUM1;i++)

       {

              printf("%d ",jiuxu[i].pid);

       }

       printf(")\n");

       scanf("%d",&p);

       for(i=0;i<NUM1;i++)

       {

              if(p==jiuxu[i].pid)

              {

                     m=cpu.daxiao;

                     cpu.daxiao=jiuxu[i].daxiao;

                     jiuxu[i].daxiao=m;

                     n=cpu.pid;

                     cpu.pid=jiuxu[i].pid;

                     jiuxu[i].pid=n;

                     t=cpu.youxian;

                     cpu.youxian=jiuxu[i].youxian;

                     jiuxu[i].youxian=t;

                     break;

              }

上一页  [1] [2] [3] [4] [5] [6] 下一页

  • 上一篇文章:
  • 下一篇文章:
  • Copyright © 2007-2012 www.chuibin.com 六维论文网 版权所有