Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
OS 1-32.docx
Скачиваний:
0
Добавлен:
01.03.2025
Размер:
300.04 Кб
Скачать

31.Briefly describe basic types of processor scheduling. Examples

The aim of processor scheduling is to assign processes to be executed by the processor or processors over time,in a way that meets system objectives,such as response time, throughput, and processor efficiency. In many systems, this scheduling activity is broken down into three separate functions: long-, medium- , and short- term scheduling.The names suggest the relative time scales with which these func- tions are performed. Aim of Scheduling

• Assign processes to be executed by the processor(s)

• Response time

• Throughput

• Processor efficiency

Long-term scheduling is performed when a new process is created. This is a decision whether to add a new process to the set of processes that are currently active.Medium-term scheduling is a part of the swapping function.This is a decision whether to add a process to those that are at least partially in main memory and therefore available for execution. Short-term scheduling is the

actual decision of which ready process to execute next.

I/o scheduling

The decision as to which process’s pending I/O request shall be

handled by an available I/O device.

Scheduling affects the performance of the system because it determines which processes will wait and which will progress. Fundamentally, scheduling is a matter of managing queues to minimize queuing delay and to optimize performance in a queuing environment.

32.What is the difference between preemptive and nonpreemptive scheduling? Examples.

The Scheduling algorithms can be divided into two categories with respect to how they deal with clock interrupts.

Nonpreemptive Scheduling A scheduling discipline is nonpreemptive if, once a process has been given the CPU, the CPU cannot be taken away from that process. Following are some characteristics of nonpreemptive scheduling

In nonpreemptive system, short jobs are made to wait by longer jobs but the overall treatment of all processes is fair.

  1. In nonpreemptive system, response times are more predictable because incoming high priority jobs can not displace waiting jobs.

  2. In nonpreemptive scheduling, a schedular executes jobs in the following two situations.

    1. When a process switches from running state to the waiting state.

    2. When a process terminates.

Preemptive Scheduling.A scheduling discipline is preemptive if, once a process has been given the CPU can taken away.

The strategy of allowing processes that are logically runable to be temporarily suspended is called Preemptive Scheduling and it is contrast to the "run to completion" method.

Nonpreemptive: In this case, once a process is in the Running state, it continues to execute until (a) it terminates or (b) it blocks itself to wait for I/O or to request some operating system service.

• Preemptive: The currently running process may be interrupted and moved to the Ready state by the operating system.The decision to preempt may be performed when a new process arrives; when an interrupt occurs that places a blocked process in the Ready state;or periodically,based on a clock interrupt.Preemptive policies incur greater overhead than nonpreemptive ones but may provide better service to the total population of processes,because they prevent any one process from monopolizing the processor for very long. In addition, the cost of preemption may be kept relatively low by using efficient process-switching mechanisms (as much help from hardware as possible) and by providing a large main memory to keep a high percentage of programs in main memory.

As we describe the various scheduling policies,we will use the set of processes

 

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]