HOME


Top 10 List of Week 08

In this Top 10 list, I will give what materials I have learned during week 8 at my Operating System course. In each of the points I stated, there is a clickable link that will take you to the website I learned the material from, my thoughts and review of the page itself, and a short summary of the material.

One Preemption

Preemption as used with respect to operating systems means the ability of the operating system to preempt (that is, stop or pause) a currently scheduled task in favour of a higher priority task. The resource being scheduled may be the processor or I/O, among others.

Non-preemptability arises, for instance, when handling an interrupt. In this case, scheduling is avoided until the interrupt is handled.

The schedulers used in most modern operating systems, such as various flavours of Unix, can preempt user processes. This is called preemptive multitasking, and is in contrast to cooperative multitasking wherein a process “gives away” its time by utilizing kernel resources or by specifically calling a kernel routine to allow other processes time to run.

Two Deadline scheduler in Operating System

Deadline Scheduler is n I/O scheduler for the Linux kernel and guarantee a start service time for a request. Deadline Scheduler imposes deadlines on all I/O operations in order to prevent wanted requests. Two deadline read and write queues (basically sorted by their deadline) are maintained. For every new request, the scheduler selects which queue will serve for it. Read queues are given high priority than write queues because during read operations the processes usually get blocked.

Three What is CPU Scheduling?

CPU Scheduling is a process of determining which process will own CPU for execution while another process is on hold. The main task of CPU scheduling is to make sure that whenever the CPU remains idle, the OS at least select one of the processes available in the ready queue for execution. The selection process will be carried out by the CPU scheduler. It selects one of the processes in memory that are ready for execution.

Four Operating System Scheduling algorithms

A Process Scheduler schedules different processes to be assigned to the CPU based on particular scheduling algorithms. There are six popular process scheduling algorithms −

These algorithms are either non-preemptive or preemptive. Non-preemptive algorithms are designed so that once a process enters the running state, it cannot be preempted until it completes its allotted time, whereas the preemptive scheduling is based on priority where a scheduler may preempt a low priority running process anytime when a high priority process enters into a ready state.

Five Process vs Thread: What’s the difference?

Process means a program is in execution, whereas thread means a segment of a process. A Process is not Lightweight, whereas Threads are Lightweight. A Process takes more time to terminate, and the thread takes less time to terminate. Process takes more time for creation, whereas Thread takes less time for creation. Process likely takes more time for context switching whereas as Threads takes less time for context switching. A Process is mostly isolated, whereas Threads share memory. Process does not share data, and Threads share data with each other.

Six Preemptive Scheduling

CPU scheduling decisions take place under one of four conditions:

  1. When a process switches from the running state to the waiting state, such as for an I/O request or invocation of the wait( ) system call.

  2. When a process switches from the running state to the ready state, for example in response to an interrupt.

  3. When a process switches from the waiting state to the ready state, say at completion of I/O or a return from wait( ).

  4. When a process terminates.

For conditions 1 and 4 there is no choice - A new process must be selected.

For conditions 2 and 3 there is a choice - To either continue running the current process, or select a different one.

If scheduling takes place only under conditions 1 and 4, the system is said to be non-preemptive, or cooperative. Under these conditions, once a process starts running it keeps running, until it either voluntarily blocks or until it finishes. Otherwise the system is said to be preemptive.

Seven CPU Scheduling in Operating Systems

Scheduling of processes/work is done to finish the work on time.

Below are different time with respect to a process.

Eight Scheduling analysis real-time systems

A real-time scheduling System is composed of the scheduler, clock and the processing hardware elements. In a real-time system, a process or task has schedulability; tasks are accepted by a real-time system and completed as specified by the task deadline depending on the characteristic of the scheduling algorithm.

Nine Approaches to Real-Time Scheduling

Different classes of scheduling algorithm used in real-time systems:

• Clock-driven

Primarily used for hard real-time systems where all properties of all jobs are known at design time, such that offline scheduling techniques can be used

• Weighted round-robin

Primarily used for scheduling real-time traffic in high-speed, switched networks

• Priority-driven

Primarily used for more dynamic real-time systems with a mix of timebased and event-based activities, where the system must adapt to changing conditions and events

Ten Scheduling in Linux

The Linux scheduler is a priority based scheduler that schedules tasks based upon their static and dynamic priorities. When these priorities are combined they form a task’s goodness . Each time the Linux scheduler runs, every task on the run queue is examined and its goodness value is computed. The task with the highest goodness is chosen to run next.