Chapter 6 Terms and Exercises

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

6.11 - Discuss how the following pairs of scheduling criteria conflict in certain settings. (a) CPU utilization and response time (b) Average turnaround time and maximum waiting time (c) I/O device utilization and CPU utilization

(a) CPU utilization and response time: CPU utilization is increased if the overheads associated with context switching is minimized. The context switching overheads could be lowered by performing context switches infrequently. This could however, result in increasing response time for processes. (b) Average turnaround time and maximum waiting time: Average turnaround time is minimized by executing the shortest tasks first. Such a scheduling policy could, however, starve long-running tasks and thereby increase their waiting time (c) I/O device utilization and CPU utilization: CPU utilization is maximized by running long-running CPU-bound tasks without performing context switches. I/O device utilization is maximized by scheduling I/O-bound jobs as soon as they become ready to run, thereby incurring the overheads of context switches

6.24 - Explain the differences in how much the following scheduling algorithms discriminate in favor of short processes: (a) FCFS (b) RR (c) Multilevel feedback queues

(a) FCFS - No benefit or penalty accrues to short processes (b) RR - Short processes will finish before longer processes (c) Multilevel feedback queues - It depends on the exact algorithm used to move processes between queues, but in general, short processes will finish before longer processes. If the scheduling algorithm tends to move IO-bound processes to higher priority queues (a reasonable assumption), then short IO-bound processes will be favored over short CPU-bound processes, both of which will be favored over longer processes

6.19 - Which of the following scheduling algorithms could result in starvation? (a) First-come, first-served (b) Shortest job first (c) Round robin (d) Priority

(a) NO starvation (b) Could result in starvation (c) NO starvation (d) Could result in starvation

CPU Scheduling Criteria

1. CPU utilization - We want to keep the CPU as busy as possible. 2. Throughput - Measure of processes that are completed per time unit. 3. Turnaround time - The interval from the time of submission of a process to the time of completion is the turnaround time. 4. Waiting time - CPU scheduling algorithm only affects the amount of time that a process spends waiting in the ready queue. Waiting time is the sum of the periods spent waiting in the ready queue. 5. Response time - The measure of time from the submission of a request until the first response is produced. The time it takes to start responding, not the time it takes to output the response. Generally limited by the speed of the output device.

Types of Scheduling Algorithms

1. First-Come, First-Served Scheduling (FCFS) 2. Shortest-Job-First Scheduling (SJF) 3. Priority Scheduling 4. Round-Robin Scheduling 5. Multilevel Queue Scheduling 6. Multilevel Feedback Queue Scheduling

4 circumstances where CPU-scheduling may take place

1. When a process switches from the running state to the waiting state (for example as the result of I/O request or an invocation of wait() for the termination of a child process) 2. When a process switches from the running state to the ready state (for example, when an interrupt occurs) 3. When a process switches from the waiting state to the ready state (for example, at completion of I/O) 4. When a process terminates.

Multilevel Feedback Queue Scheduling

Allows a process to move between queues. The idea is to separate processes according to the characteristics of their CPU bursts. If a process uses too much CPU time, it will be moved to a lower-priority queue. Prevents starvation.

Short Term Scheduler

Also called a CPU scheduler or a dispatcher. Its main objective is to increase system performance in accordance with the chosen set of criteria. It is the change of ready state to running state of the process. CPU scheduler selects a process among the processes that are ready to execute and allocates CPU to one of them.

Long Term Scheduler

Also called a job scheduler. It determines which programs are admitted to the system for processing. It selects processes from the queue and loads them into memory for execution. Process loads into the memory for CPU scheduling.

6.16 - Do this on paper

Do this on paper

Hard real-time systems

Have stricter requirements that soft real-time systems. A task must be serviced by its deadline; service after the deadline has expired is the same as no service at all.

First-Come, First-Served Scheduling (FCFS)

Jobs are executed on first come, first serve basis. It is a non-preemptive scheduling algorithm. Pros: Easy to understand and implement. Its implementation is based on FIFO queue. Cons: Poor performance as average wait time is high.

Swapping

Name this concept: A running process may become suspended if it makes an I/O request. A suspended process cannot make any progress towards completion. In this condition, to remove the process from memory and make space for other processes, the suspended process is moved to the secondary storage.

Multilevel Queue Scheduling

Partitions the ready queue into several separate queues. The processes are permanently assigned to one queue, generally based on some property of the process, such as memory size, process priority or process type. Each queue has its own scheduling algorithm.

6.2 - Explain the difference between preemptive and nonpreemptive scheduling:

Preemptive scheduling allows a process to be interrupted in the midst of its execution, taking the CPU away and allocating it to another process. Nonpreemptive scheduling ensures that a process relinquishes control of the CPU only when it finishes with its current CPU burst.

Preemptive Scheduling

Preemptive scheduling is prioritized. Highest priority process should always be the process that is currently utilized. Preemptive algorithms are driven by the notion of prioritized computation. The process with the highest priority should always be the one currently using the processor. If a process is currently using the processor and a new process with a higher priority enters, the ready list, the process on the processor should be removed and returned to the ready list until it is once again the highest priority process in the system.

Priority Scheduling

Priority scheduling is a non-preemptive algorithm and one of the most common scheduling algorithms in batch systems. Each process is assigned a priority. Process with highest priority is to be executed first and so on. Processes with same priority are executed on first come first served basis. Priority can be decided based on memory requirements, time requirements or any other resource requirement.

6.4 - What advantage is there in having different time-quantum sizes at different levels of a multilevel queuing system?

Processes that need more frequent servicing, for instance, interactive processes such as editors, can be in a queue with a small time quantum. Processes with no need for frequent servicing can be in a queue with a larger quantum, requiring fewer context switches to complete the processing, and thus making more efficient use of the computer.

Soft real-time systems

Provide no guarantee as to when a critical real-time process will be scheduled. They guarantee only that the process will be given preference over noncritical processes.

Round Robin Scheduling

Round Robin is the preemptive process scheduling algorithm. Each process is provided a fixed time to execute, it is called a quantum. Once a process is executed for a given time period, it is preempted and other process executes for a given time period. Context switching is used to save states of preempted processes.

Shortest Job First (SJF)

This is a non-preemptive or preemptive scheduling algorithm. The processor should know in advance how much time the process will take. Pros: Best approach to minimize waiting time. Easy to implement in batch systems where required CPU time is known in advance. Cons: Impossible to implement in interactive systems where required CPU time is not known.

Medium Term Scheduler

This is a part of swapping. It removes the processes from the memory. It reduces the degree of multiprogramming. This is in-charge of handling the swapped out processes.

Special issues involved in real-time CPU scheduling.

We can distinguish between soft real-time systems and hard real-time systems.

Non-Preemptive Scheduling

When a process enters the state of running, the state of that process is not deleted from the scheduler until it finishes its service time. Non-preemptive algorithms are designed so that once a process enters the running state (is allowed a process), it is not removed from the processor until it has completed its service time (or it explicitly yields the processor). context_switch() is called only when the process terminates or blocks. In non-preemptive scheduling, a running task is executed until completion. It cannot be interrupted.

6.5 - What if any relation holds between the following pairs of algorithm sets? a. Priority and SJF b. Multilevel feedback queues and FCFS c. Priority and FCFS d. RR and SJF

a. Shortest job has the highest priority. b. The lowest level of MLFQ is FCFS c. FCFS gives the highest priority to the job having been in existence the longest. d. None.


संबंधित स्टडी सेट्स

Criminal Justice--Chapter 3: Criminal Law and the Criminal Justice Process, CCJ Final, CCJ 2002 Chapter 1, soca 234 criminal justice system corey colyer exam 1, soca 234 criminal justice wvu colyer exam 2 (ch 4,5,6), soca 234 wvu colyer exam 3, soca...

View Set

Chapter 39 Ports Pathophysiology

View Set

Quantitative reasoning quiz 7 practice

View Set

Ch 24 Disorders of Infants, Children and Adolescents

View Set

Chapter 5: Corporate Social Responsibility

View Set

what causes the Spanish American war and how does it end, what does America get?

View Set

Unit 5 Thermodynamics- AP Chem- Doc Bennett

View Set

Fundamentals Exam 1 (Potter & Perry Chapter Practice Questions)

View Set