Preemptive and Non-Preemptive Algorithm in Operating System

Preemptive Scheduling Algorithm Here, a scheduler can preempt a running low-priority process at any time when a high-priority process enters a ready state. In preemptive systems, the OS takes the processor away from a running process. If the algorithm assumes one of the following circumstances, it is a preemptive algorithm – When a process transitions … Read more

CPU scheduling algorithms Criteria in Operating System

There are different criteria for the CPU scheduling algorithm. CPU scheduling algorithms Criteria are CPU utilization: The main purpose of every scheduling algorithm is to keep the CPU busy. The utilization of the CPU can range from 0 to 100. CPU utilization is the percentage of the time interval in which the processor is busy … Read more

Sleeping Barber Problem of Synchronization in Operating System

It is a synchronization and inter-process communication problem. This problem is based on a barbershop. A barbershop has a single barber, single barber chair and n number of chairs for customers. When there is no customer in the barbershop then the barber sleeps. When a customer comes, he has to get up the barber. When … Read more

Reader-Writer Problem in Operating System with Code

The readers and writers problem based on an object like a file which is shared in different processes. Some processes are readers so that they can only read the data and some processes are writers so that they can only write the data. This problem is generally used to manage synchronization.  A writer should achieve … Read more

Discuss the Classical problem of synchronization

Using semaphores for synchronization is the traditional way to present the solutions. There are four types of the classical problem of synchronization, and these are the following:  Four types of the classical problem of synchronization 1). Bound buffer problem It is also named as Producer-consumer problem. A bounded buffer allows many producers and many consumers … Read more

Semaphore in Operating System and its types

A semaphore is simply an integer variable that is shared between multiple threads. We can also say A semaphore is a data structure with an initialization operation and two usage operations. The data structure consists of a counter and a queue for picking up blocked processes. The concept comes from Dijkstra and was presented in … Read more

Mutual exclusion in Operating System with its four conditions

When a process is executed in a critical section, then no other process can be executed in their critical section. It consists of a single process temporarily excluding all others from using a shared resource in a way that guarantees the integrity of the system. It assures that when one thread is functioning read or … Read more

Concurrency in Operating System and Principle of Concurrency

Concurrency in Operating System refers to the execution of several programs at the same time. It takes place in OS when multiple processes are executing in parallel. It is the execution of processes to provide an impression of a synchronous computation. In Concurrency, resources are shared among the processes that result in troubles such as … Read more

Dispatcher in Operating System. Write Functions of Dispatcher

Dispatcher provides control of the CPU to the process picked by the short-term scheduler. When the scheduler finishes its task of selecting a process, then the dispatcher takes that process to the destination state.  For example, Suppose there are 5 processes P1, P2, P3, P4, and P5.  The arrival times of these processes are T1, … Read more