os202

Repository for Operating Systems 202 Course 2020/2021

View project on GitHub

HOME
« PREVIOUS |

Top 10 List of Week 09

  1. 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.

  2. Preemptive vs Non-Preemptive Scheduling
    In Preemptive Scheduling, the tasks are mostly assigned with their priorities. In Non-preemptive Scheduling, the CPU has been allocated to a specific process. To determine if scheduling is preemptive or non-preemptive, consider these four parameters: 1) A process switches from the running to the waiting state; 2) Specific process switches from the running state to the ready state; 3) Specific process switches from the waiting state to the ready state; 4) Process finished its execution and terminated. If only conditions 1 and 4 apply, the scheduling is called non-preemptive. All other scheduling are preemptive.

  3. Scheduling Algorithms
    There are various algorithms which are used by the Operating System to schedule the processes on the processor in an efficient way. The purpose of a scheduling algorithm is to get: Maximum CPU utilization, Fare allocation of CPU, Maximum throughput, Minimum turnaround time, Minimum waiting time, and Minimum response time. There are mainly six types of process scheduling algorithms: First Come First Serve (FCFS), Shortest-Job-First (SJF) Scheduling, Shortest Remaining Time, Priority Scheduling, Round Robin Scheduling, and Multilevel Queue Scheduling.

  4. CPU & I/O Burst Cycle
    CPU/IO burst cycle: Characterizes process execution, which alternates between CPU and I/O activity. CPU times are usually shorter than the time of I/O. Almost all programs have some alternating cycle of CPU number crunching and waiting for I/O of some kind. In a simple system running a single process, the time spent waiting for I/O is wasted, and those CPU cycles are lost forever. A scheduling system allows one process to use the CPU while another is waiting for I/O, thereby making full use of otherwise lost CPU cycles. Almost all processes alternate between two states in a continuing cycle: A CPU burst of performing calculations, and an I/O burst, waiting for data transfer in or out of the system.

  5. What is Dispatcher?
    A Dispatcher is a module that provides control of the CPU to the process. The Dispatcher should be fast so that it can run on every context switch. Dispatch latency is the amount of time needed by the CPU scheduler to stop one process and start another. Functions performed by Dispatcher are: Context Switching, Switching to user mode, and Moving to the correct location in the newly loaded program.

  6. What is Thread Scheduling?
    We introduced threads to the process model, distinguishing between user-level and kernel-level threads. On operating systems that support them, it is kernel-level threads—not processes—that are being scheduled by the operating system. User-level threads are managed by a thread library, and the kernel is unaware of them. To run on a CPU, user-level threads must ultimately be mapped to an associated kernel-level thread, although this mapping may be indirect and may use a lightweight process (LWP).

  7. User-level vs Kernel-level Threads
    The two main types of threads are User-level threads and Kernel-level threads. User-level threads are implemented by users and the kernel is not aware of the existence of these threads. It handles them as if they were single-threaded processes. User-level threads are small and much faster than kernel level threads. Kernel-level threads are handled by the operating system directly and the thread management is done by the kernel. The context information for the process as well as the process threads is all managed by the kernel. Because of this, kernel-level threads are slower than user-level threads.

  8. Multiprocessor Scheduling in Operating System
    In the multiprocessor scheduling, there are multiple CPU’s which share the load so that various process run simultaneously. In general, the multiprocessor scheduling is complex as compared to single processor scheduling. In the multiprocessor scheduling, there are many processors and they are identical and we can run any process at any time. The multiple CPU’s in the system are in the close communication which shares a common bus, memory and other peripheral devices. So we can say that the system is a tightly coupled system. These systems are used when we want to process a bulk amount of data. These systems are mainly used in satellite, weather forecasting etc.

  9. What is Completely Fair Scheduler (CFS)?
    Completely fair Scheduler (CFS) is based on Rotating Staircase Deadline Scheduler (RSDL). It is default scheduling process in Linux since version 2.6.23 in 2007. It has elegant handling of I/O and CPU bound process. As the name suggest it fairly or equally divides the CPU time among all the processes.Before understanding the CFS lets look at Ideal Fair Scheduling (IFS) of N processes. If there are N processes in the ready queue then each process receives (100/N)% of CPU time according to IFS.

  10. What is Real Time Scheduling?
    In the simplest real-time systems, where the tasks and their execution times are all known, there might not even be a scheduler. One task might simply call (or yield to) the next. This model makes a great deal of sense in a system where the tasks form a producer/consumer pipeline (e.g. MPEG frame receipt, protocol decoding, image decompression, display). In more complex real-time system, with a larger (but still fixed) number of tasks that do not function in a strictly pipeline fashion, it may be possible to do static scheduling. Based on the list of tasks to be run, and the expected completion time for each, we can define (at design or build time) a fixed schedule that will ensure timely execution of all tasks.