文件名称:ProcessScheduling
介绍说明--下载内容均来自于网络,请自行研究使用
设计一个有 N个进程并行的优先级调度程序:每个进程有一个进程控制块( PCB)表示。进程控制块可以包含如下信息:进程名、优先数、到达时间、需要运行时间、已用CPU时间、进程状态等等。
进程的优先数及需要的运行时间可以事先人为地指定(也可以由随机数产生)。进程的到达时间为进程输入的时间。
进程的运行时间以时间片为单位进行计算。
每个进程的状态可以是就绪 W(Wait)、运行R(Run)、或完成F(Finish)三种状态之一。
就绪进程获得 CPU后都只能运行一个时间片。用已占用CPU时间加1来表示。
如果运行一个时间片后,进程的已占用 CPU时间已达到所需要的运行时间,则撤消该进程,如果运行一个时间片后进程的已占用CPU时间还未达所需要的运行时间,也就是进程还需要继续运行,此时应将进程的优先数减1(即降低一级),然后把它插入就绪队列等待CPU。
每进行一次调度程序都打印一次运行进程、就绪队列、以及各个进程的 PCB,以便进行检查。
重复以上过程,直到所要进程都完成为止。-Design of a parallel to the process N one priority scheduling process: Each process has a process control block (PCB) said. Process control block may contain the following information: process name, priority number, arrival time, need to run time, has spent CPU time, the process of the state and so on.
The process priority number and needs of the running time can be artificially designated in advance (you can also by a random number generator). Process, the arrival time for the process input time.
The process of running time to time slices are calculated as a unit.
The state of each process can be ready W (Wait), run the R (Run), or the completion of F (Finish), one of three states.
Ready access to CPU after the process can only run one time slice. CPU time has been occupied with the plus one indication of this.
If you are running a time slice, after the process has been CPU-time has reached the required running time, then undo the process, if a time slice to run after the pr
进程的优先数及需要的运行时间可以事先人为地指定(也可以由随机数产生)。进程的到达时间为进程输入的时间。
进程的运行时间以时间片为单位进行计算。
每个进程的状态可以是就绪 W(Wait)、运行R(Run)、或完成F(Finish)三种状态之一。
就绪进程获得 CPU后都只能运行一个时间片。用已占用CPU时间加1来表示。
如果运行一个时间片后,进程的已占用 CPU时间已达到所需要的运行时间,则撤消该进程,如果运行一个时间片后进程的已占用CPU时间还未达所需要的运行时间,也就是进程还需要继续运行,此时应将进程的优先数减1(即降低一级),然后把它插入就绪队列等待CPU。
每进行一次调度程序都打印一次运行进程、就绪队列、以及各个进程的 PCB,以便进行检查。
重复以上过程,直到所要进程都完成为止。-Design of a parallel to the process N one priority scheduling process: Each process has a process control block (PCB) said. Process control block may contain the following information: process name, priority number, arrival time, need to run time, has spent CPU time, the process of the state and so on.
The process priority number and needs of the running time can be artificially designated in advance (you can also by a random number generator). Process, the arrival time for the process input time.
The process of running time to time slices are calculated as a unit.
The state of each process can be ready W (Wait), run the R (Run), or the completion of F (Finish), one of three states.
Ready access to CPU after the process can only run one time slice. CPU time has been occupied with the plus one indication of this.
If you are running a time slice, after the process has been CPU-time has reached the required running time, then undo the process, if a time slice to run after the pr
(系统自动生成,下载前可以参看下载内容)
下载文件列表
ProcessScheduling.c