disadvantages of priority scheduling
The priority scheduling algorithm is a kind of CPU scheduling algorithm where the processes that wait for the CPU are scheduled according to their priority..
Advantages of Priority Scheduling-1.Simplicity.2.Reasonable support for priority.3.Suitable for applications with varying time and resource requirements.Disadvantages of Priority Scheduling-1.Indefinite blocking or starvation.2.A priority scheduling can leave some low priority waiting processes indefinitely for CPU.3.If the system eventually crashes then all unfinished low priority processes gets lost.
In that work system, the shortest job gets higher priority because more gets accomplished in any amount of time. If you have two hours to do 4 tasks and one task will take five minutes, one will take 30 minutes, one will take an hour and one will take an hour and a half, by using the shortest job first method, you will accomplish three tasks in those two hours and part of the fourth task. If you do the longest job first, you will accomplish the task that takes an hour and a half, then only part of the one hour task, but nothing on the 5 minute or 30 minute tasks. That means that by doing the shortest jobs first, you will accomplish three times as many tasks as you will by doing the longest jobs first.
In priority scheduling, if two processes have the same priority, some operating systems may use a secondary criteria, such as time since last execution or process ID, to determine the order in which they are executed. Alternatively, the operating system may use a first-come-first-serve basis for scheduling processes with the same priority.
Yes. For Example, many operating systems have two schedulers, one for high priority\realtime processes such as gui elements and another for low priority\background processes. The high priority\gui scheduler will usually use a scheme such as SRTF (shortest remaining time first) or SJF (shortest job first), while the low priority\background scheduler may use a scheme such as RR (round robin).
Cooperative schedulingPreemptive scheduling Rate-monotonic schedulingRound-robin schedulingFixed priority pre-emptive scheduling, an implementation of preemptive time slicingFixed-Priority Scheduling with Deferred PreemptionFixed-Priority Non-preemptive SchedulingCritical section preemptive schedulingStatic time schedulingEarliest Deadline First approachStochastic digraphs with multi-threaded graph traversal
find primitive sjf? with avg waiting time and TAW? P Bust TIme Arivel time p1 5 1 p2 3 0 p3 2 2 p4 4 3 p5 8 2
Priority based algorithm
Linux usually uses a pre-emptive scheduler, which means a process will run until either it makes a system call, or its time slice runs out. This is as opposed to a cooperative scheduler, which allows a process to run until it deems itself ready to go from running to ready state. Needless to say, preemption is a much better model, keeping misbehaving processes from starving other processes of CPU time.
it depends what is critical to meet deadline.
it depends what is critical to meet deadline.