Lobo, Lester C. Prelim Examination CPCS413 1. Why do we need Process Management in an Operating System? -It is an important part of the operating system. It allows you to control the way your computer runs by managing the currently active processes. 2. What are the attributes of a process? Process ID Program counter Process State Priority General Purpose Registers List of open files List of open devices 3. What are the four "Operations on the Process"? Creation -Once the process is created, it will be ready and come into the ready queue (main memory) and will be ready for the execution. Scheduling -Out of the many processes present in the ready queue, the Operating system chooses one process and start executing it. Selecting the process which is to be executed next, is known as scheduling. Execution -Once the process is scheduled for the execution, the processor starts executing it. Process may come to the blocked or wait state during the execution then in that case the processor starts executing the other processes. Deletion/killing -Once the purpose of the process gets over then the OS will kill the process. The Context of the process (PCB) will be deleted and the process gets terminated by the Operating system. 4. Explain the states of a process using a "State Diagram" 5. What is the purpose of Scheduling Algorithms? -The main purposes of scheduling algorithms are to minimize resource starvation and to ensure fairness amongst the parties utilizing the resources. Scheduling deals with the problem of deciding which of the outstanding requests is to be allocated resources. There are many different scheduling algorithms. 6. Explain Each type of Scheduling algorithm. Preemptive Scheduling Algorithms -In these algorithms, processes are assigned with a priority. Whenever a high-priority process comes in, the lower-priority process which has occupied the CPU is preempted. That is, it releases the CPU, and the high-priority process takes the CPU for its execution. Non-Preemptive Scheduling Algorithms -In these algorithms, we cannot preempt the process. That is, once a process is running in CPU, it will release it either by context switching or terminating. Often, these are the types of algorithms that can be used because of the limitation of the hardware. There are some important terminologies to know for understanding the scheduling algorithms: o Arrival Time: This is the time at which a process arrives in the ready queue. o Completion Time: This is the time at which a process completes its execution. o Burst Time: This is the time required by a process for CPU execution. o Turn-Around Time: This is the difference in time between completion time and arrival time. This can be calculated as: Turn Around Time = Completion Time – Arrival Time. Waiting Time: This is the difference in time between turnaround time and burst time. This can be calculated as: Waiting Time = Turn Around Time – Burst Time. Throughput: It is the number of processes that are completing their execution per unit time.