Sei sulla pagina 1di 1

Assignment : 2

1 Scheduling algorithms decide which of the processes in the ready queue is to be allocated to the CPU is basis on the type of scheduling policy and whether that policy is either preemptive or non-preemptive. For scheduling arrival time and service time also play a role. List of scheduling algorithms are as follows:
First-come, first-served scheduling (FCFS) algorithm Shortest Job First Scheduling (SJF) algorithm Shortest Remaining time (SRT) algorithm Non-preemptive priority Scheduling algorithm Preemptive priority Scheduling algorithm Round-Robin Scheduling algorithm Multilevel Queue Scheduling algorithm Multilevel Feedback Queue Scheduling algorithm Lottery Scheduling algorithm Fair share Scheduling algorithm Guaranteed Scheduling

2. 1

Explain each of the above scheduling algorithm in brief with its advantages and disadvantages. Suppose the following jobs arrived for processing at the time indicated with the given priority and each job will run for the listed amount of time. Find out average waiting time and average turn round time for First Come First Serve, Shortest Job First, Shortest Remain Time Job First, preemptive & non preemptive priority and round robin scheduling algorithm. Process ID 1 2 3 4 5 Time of Arrival 0 2 4 8 12 Arrival time 0 3 5 8 Time of Arrival 0 2 4 5 Execution Time 10 1 2 4 3 Service Time 4 6 3 2 Burst Time 7 4 1 4 Priority 20 10 58 40 30 Priority 2 1 3 1 Priority 5 2 1 3 time quantum: 2 ms

2. 2

time quantum: 1 ms

2. 3

Process ID P1 P2 P3 P4

2. 4

Process ID 1 2 3 4

time quantum: 1 ms

3. 1 3. 2 3.

Explain each of the solutions to achieve mutual exclusion using busy waiting. (Disabling Interrupts, Lock Variables, Strict Alteration & Petersons Solution) What is mutex? How it helps to achieve mutual exclusion? What is Semaphore? Explain Producer Consumer Problem with Bounded Buffer using

Potrebbero piacerti anche