Docsity

Operating System Assignment III: CPU Scheduling and Process Table Analysis - Prof. Sorne, Study Guides, Projects, Research of Computer Security

Partial preview of the text

Download Operating System Assignment III: CPU Scheduling and Process Table Analysis - Prof. Sorne and more Study Guides, Projects, Research Computer Security in PDF only on Docsity!

DEPARTMENT OF COMPUTER

SCIENCE

ND

YEAR SECTION-A

PROGRAM EXTENSION

OPERATING SYSYTEM

INDIVIDUAL

ASSIGNMENT-III

Name ID

Girma Alemu

Operating System Assignment-III Chapter three

  1. Explain the two types of CPU scheduling. Non-preemptive:- Run to completion method once a process is in running state, it continues to execute until it terminates or blocks it self to wait for some event.  Simple and easy to implement.  Used in early batch systems.

 It may be well reason a before some dedicated systems.

Preemptive:- The strategy of allowing processes that are logically run able to be temporarily suspended and be moved to the ready state.  Events that may result pre-emption are arrival of new processes, occurrence of an interrupt that moves blocked process to ready state and clock interrupt.

 Suitable for general purpose systems with multiple users.

  1. Discuss about CPU bound processes and I/O bound processes.  CPU bound process it would go faster it the CPU were faster it spends the majority of its time simply ace[ted using the CPU doing calculations.  A program that computer new digits of μ will typically be CPU bound its just crunching number.  The CPU bound means the rate at which process progresses is limited by the speed of the CUP.  I/O bound its would go faster it the I/O sub system was faster. which exact I/O system is can very typically associate it with disk but of networking or communication in general is common too.  A program that looks through a huge file for some data might became I/O bound since the bottleneck is then reading of the data from disk actually this example is perhaps kind of old-fashioned these days with hundreds of MB/s coming in form SSDS

Average response time= (3+23+3+17+0)/5= 9.2ms p5=20-10=10ms p4=45-7=38ms p3=13-5=8ms p2=30-3=27ms p1=8-0=8ms ATAT =(10+38+8+27+8)/5= 18.2ms b. Using round robin scheduling algorithm when quantum =5ms. Algorithm round robin Average response time 18.2 ms Average turnaround times 27.2 ms Gant chart P1 p2 p3 p4 p5 p1 p2 p4 p5 p 0 5 10 15 20 25 28 84 38 40 45 Computation p5=20+(38-25)-10=23ms p4=15+(33-20)+(40-38)-7=23ms p3=10-5=5ms p2=5+(28-10)-3=20ms p1=0+(25-5)-0=20ms average response time=(23+23+5+20+20)/5= 18.2ms p5=40-10=30ms p4=45-7=38ms p3=15-5=10ms p2=33-3=30ms p1=28-0=28ms ATAT=(30+38+10+30+28)/5= 27.2ms

  1. List all CPU Scheduling algorithms and identify their advantages and drawbacks for each. First come first serve  Advantages :-It produces optimal average turnaround time and average response time. There is a minimum over head.  Drawbacks Starvation some processes may not get the CPU at all as long as there is as toady supply of shorter processes.  Variability of response time is increased, especially for longer processes.  The process with less execution time suffer i.e. waiting time is often quite long.  Favors CPU bound process then I/O bound process. Shortest job first preemptive & non-preemptive shortest jobs are favored.  It is provably optimal in that it gives the minimum average waiting time for a given set of processes. Drawbacks:-  SJF may cause starvation if shorter processes keep coming. This problem is solved by aging.  It cannot be implemented at the level of short term CPU scheduling. Round robin Advantage:- every process gets equal share of the CPU. Round robin is cycle in nature so there in no starvation. Drawback :- CPU bound processes tend to received unfair portion of CPU time. Priority based Advantages:- this provide a good mechanism where the relative importance of each may be precisely defined. Drawbacks:- A high priority processes my run indefinitely and it can prevent all other processes form running.