DOC PREVIEW
UB CSE 421 - Uniprocessor scheduling

This preview shows page 1-2-14-15-29-30 out of 30 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Uniprocessor schedulingIntroductionClassification of Scheduling ActivityTopics for discussionThe CPU-I/O CycleMotivationSlide 7Types of schedulingShort-term schedulingShort-term scheduling criteriaPriority queuesAlternative scheduling policiesCase-studyFirst Come First Served (FCFS)FCFS drawbacksRound robinRound-RobinTime Quantum for Round RobinRound Robin: critiqueShortest process nextShortest process next (contd.)Shortest Process Next (SPN)Estimating the required CPU burstSlide 24Exponentially Decreasing CoefficientsSlide 26Shortest Process Next: critiqueOther policiesExercisesSummary01/13/19 B.Ramamurthy 1Uniprocessor schedulingB.RamamurthyCSE42101/13/19 B.Ramamurthy 2IntroductionAn important aspect of multiprogramming is scheduling. The resources that are scheduled are IO and processors. The goal is to achieveHigh processor utilizationHigh throughputnumber of processes completed per unit timeLow response timetime elapse from the submission of a request to the beginning of the response01/13/19 B.Ramamurthy 3Classification of Scheduling ActivityLong-term: which process to admitMedium-term: which process to swap in or outShort-term: which ready process to execute next01/13/19 B.Ramamurthy 4Topics for discussionMotivationTypes of schedulingShort-term schedulingVarious scheduling criteriaVarious algorithmsPriority queuesFirst-come, first-servedRound-robinShortest process firstShortest remaining time and othersQueuing model - perf analysis01/13/19 B.Ramamurthy 5The CPU-I/O CycleWe observe that processes require alternate use of processor and I/O in a repetitive fashionEach cycle consist of a CPU burst (typically of 5 ms) followed by a (usually longer) I/O burst A process terminates on a CPU burstCPU-bound processes have longer CPU bursts than I/O-bound processes01/13/19 B.Ramamurthy 6MotivationConsider these programs with processing-component and IO-component indicated by upper-case and lower-case letters respectively. A1 a1 A2 a2 A30 30 50 80 120 130 ===> JOB A B1 b1 B20 20 40 60 ====> JOB B C1 c1 C2 c2 C3 c3 C4 c4 C5 0 10 20 60 80 100 110 130 140 150 =>JOB C01/13/19 B.Ramamurthy 7MotivationThe starting and ending time of each component are indicated beneath the symbolic references (A1, b1 etc.)Now lets consider three different ways for scheduling: no overlap, round-robin, simple overlap.Compare utilization U = Time CPU busy / Total run time01/13/19 B.Ramamurthy 8Types of schedulingLong-term : To add to the pool of processes to be executed.Medium-term : To add to the number of processes that are in the main memory.Short-term : Which of the available processes will be executed by a processor?IO scheduling: To decide which process’s pending IO request shall be handled by an available IO device.01/13/19 B.Ramamurthy 9Short-term schedulingShort-term scheduler is invoked whenever an event occurs that may lead to the interruption of the current process or that may warrant the preemption of the current process in favor of another.Clock-interrupts, IO interrupts, OS calls, signals, real-time system policies are some such events.The main objective of short-term scheduling is to allocate processor time in such a way as to optimize one or more aspects of system behavior.01/13/19 B.Ramamurthy 10Short-term scheduling criteriaUser-oriented: Response time: is the elapsed time between the submission of a request until the response begins to appear at the output.Typical goal of such system should be maximize the number of users who would experience average or better than average response time.System-oriented:Throughput: is the rate at which processes are completed.Focus is on the efficient and effective use of processors.Utilization : % of time a processor is kept busy.01/13/19 B.Ramamurthy 11Priority queuesAn important aspect of scheduling is the use of priorities. See Fig.9.4One ready queue for each priority level;Or one priority queue. Insertion into the queue is done according to the priority.When released from a blocked queue, a process enters a queue according to its priority.01/13/19 B.Ramamurthy 12Alternative scheduling policies A selection function determines which among the ready processes is next selected for execution Selection functions are based on one or more of these items:1) w - time spent in system so far, waiting and executing.2) e - time spent on execution so far.3) s - total service time required by the process.4) resources required by the processWhen to apply the selection function is dependent on whether a preemptive or non-preemptive scheduling is used.01/13/19 B.Ramamurthy 13Case-studyLets study each of policies with a sample problem:Process Arrival time Service time===========================1 0 32 2 63 4 44 6 55 8 201/13/19 B.Ramamurthy 14First Come First Served (FCFS)Selection function: the process that has been waiting the longest in the ready queue (hence, FCFS)Decision mode: nonpreemptivea process run until it blocks itself01/13/19 B.Ramamurthy 15FCFS drawbacksA process that does not perform any I/O will monopolize the processorFavors CPU-bound processesI/O-bound processes have to wait until CPU-bound process completesThey may have to wait even when their I/O are completed (poor device utilization)we could have kept the I/O devices busy by giving a bit more priority to I/O bound processes01/13/19 B.Ramamurthy 16Round robinCPU is time-sliced among the ready processes.Time-quantum slightly higher than the typical interaction time.Appears fair but tends to favor CPU-bound jobs.01/13/19 B.Ramamurthy 17Selection function: same as FCFSDecision mode: preemptivea process is allowed to run until the time slice period (quantum, typically from 10 to 100 ms) has expiredthen a clock interrupt occurs and the running process is put on the ready queue Round-Robin01/13/19 B.Ramamurthy 18Time Quantum for Round Robinmust be substantially larger than the time required to handle the clock interrupt and dispatching should be larger then the typical interaction (but not much more to avoid penalizing I/O bound processes)01/13/19 B.Ramamurthy 19Round Robin: critiqueStill favors CPU-bound processesA I/O bound process uses the CPU for a time less than the time quantum and then is blocked waiting for I/OA CPU-bound process run for all its time slice and is put back into the ready queue


View Full Document

UB CSE 421 - Uniprocessor scheduling

Documents in this Course
Security

Security

28 pages

Threads

Threads

24 pages

Security

Security

20 pages

Security

Security

52 pages

Security

Security

20 pages

Load more
Download Uniprocessor scheduling
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Uniprocessor scheduling and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Uniprocessor scheduling 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?