Posts

Showing posts from July, 2024

Priority Scheduling Program in C

  Priority Scheduling Program in C Priority Scheduling  is a CPU scheduling algorithm in which the CPU performs the task having higher priority at first. If two processes have the same priority then scheduling is done on  FCFS  basis (first come first serve). Priority Scheduling is of two types :  Preemptive  and  Non-Preemptive . Preemptive:  In this case, resources can be voluntarily snatched. Non-Preemptive:  In this type, if a process is once started, it will execute completely i.e resources cannot be snatched. Following are the basic terminologies: Waiting Time:  Time for which the process has to wait in the ready queue. Turn Around Time:  Total time taken by the process for execution (waiting time + burst time). Problem Description: Write a C Program to implement priority scheduling. Example: Following is the example of non preemptive scheduling with arrival time zero. Process Burst Time Priority P1