os202

Repository for Operating Systems 202 Course 2020/2021

View project on GitHub

HOME
« PREVIOUS | | NEXT »

Top 10 List of Week 06

  1. Process Management
    A process is basically a program in execution. The execution of a process must progress in a sequential fashion. A process is defined as an entity which represents the basic unit of work to be implemented in the system. To put it in simple terms, we write our computer programs in a text file and when we execute this program, it becomes a process which performs all the tasks mentioned in the program. When a program is loaded into the memory and it becomes a process, it can be divided into four sections ─ stack, heap, text and data.

  2. States of a Process in Operating Systems
    The process, from its creation to completion, passes through various states, which are: 1) New: Newly Created Process or being-created process; 2) Ready: After creation process moves to Ready state, i.e. the process is ready for execution; 3) Run: Currently running process in CPU (only one process at a time can be under execution in a single processor); 4) Wait/Block: When a process requests I/O access; 5) Complete/Terminated: The process completed its execution; 6) Suspended Ready: When the ready queue becomes full, some processes are moved to suspended ready state; 7) Suspended Block: When waiting queue becomes full.

  3. Process Table and Process Control Block (PCB)
    While creating a process the operating system performs several operations. To identify the processes, it assigns a process identification number (PID) to each process. As the operating system supports multi-programming, it needs to keep track of all the processes. For this task, the process control block (PCB) is used to track the process’s execution status. Each block of memory contains information about the process state, program counter, stack pointer, status of opened files, scheduling algorithms, etc. All these information is required and must be saved when the process is switched from one state to another. When the process makes a transition from one state to another, the operating system must update information in the process’s PCB.

  4. What is Process Scheduling?
    Process Scheduling is an OS task that schedules processes of different states like ready, waiting, and running. Process scheduling allows OS to allocate a time interval of CPU execution for each process. Another important reason for using a process scheduling system is that it keeps the CPU busy all the time. This allows you to get the minimum response time for programs. There are mainly three types of Process Schedulers: Long Term, Short Term, and Medium Term.

  5. Dispatcher vs Scheduler
    Consider a situation, where various processes are residing in the ready queue waiting to be executed. The CPU cannot execute all of these processes simultaneously, so the operating system has to choose a particular process on the basis of the scheduling algorithm used. So, this procedure of selecting a process among various processes is done by the scheduler. Once the scheduler has selected a process from the queue, the dispatcher comes into the picture, and it is the dispatcher who takes that process from the ready queue and moves it into the running state. Therefore, the scheduler gives the dispatcher an ordered list of processes which the dispatcher moves to the CPU over time.

  6. What is Context Switching in Operating System?
    A context switching is a process that involves switching of the CPU from one process or task to another. In this phenomenon, the execution of the process that is present in the running state is suspended by the kernel and another process that is present in the ready state is executed by the CPU. It is one of the essential features of the multitasking operating system. The processes are switched so fastly that it gives an illusion to the user that all the processes are being executed at the same time.

  7. Process Creation vs Process Termination
    A process may be created by another process using fork(). The creating process is called the parent process and the created process is the child process. A child process can have only one parent but a parent process may have many children. Both the parent and child processes have the same memory image, open files and environment strings. However, they have distinct address spaces. Process termination occurs when the process is terminated The exit() system call is used by most operating systems for process termination.

  8. Role of Interrupts
    Interrupts are signals sent to the CPU by external devices, normally I/O devices. They tell the CPU to stop its current activities and execute the appropriate part of the operating system. There are three types of interrupts: Hardware Interupts, Software Interupts, and Traps. Interrupts are important because they give the user better control over the computer. Without interrupts, a user may have to wait for a given application to have a higher priority over the CPU to be ran. This ensures that the CPU will deal with the process immediately.

  9. What is Inter Process Communication (IPC)?
    Inter process communication (IPC) is used for exchanging data between multiple threads in one or more processes or programs. The Processes may be running on single or multiple computers connected by a network. The full form of IPC is Inter-process communication. It is a set of programming interface which allow a programmer to coordinate activities among various program processes which can run concurrently in an operating system. This allows a specific program to handle many user requests at the same time.

  10. What are Threads?
    Thread is an execution unit which consists of its own program counter, a stack, and a set of registers. Threads are also known as Lightweight processes. Threads are popular way to improve application through parallelism. The CPU switches rapidly back and forth among the threads giving illusion that the threads are running in parallel. As each thread has its own independent resource for process execution, multpile processes can be executed parallely by increasing number of threads.