What is Deadlock in OS? Explain with the help of a diagram.

A deadlock is a condition where each of the processes is waiting for a resource which is allotted to other processes. In this case, the process gets computed after the resource it requires is controlled by other processes, which is also looking for some other resource to be issued. For example, suppose two freight trains … Read more

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

Critical Section Problem in Operating System

A contention situation arises if two independent programs or processes want to access common data, and this can lead to a collision. Code segments that access common data areas, are prone to collisions known as critical sections. A critical section is understood as program parts that must not be interrupted by other processes or threads … Read more

Concurrency in Operating System with Its principle

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