Categories
Operating System

Non-contiguous memory allocation

Non-contiguous memory allocation             In non-contiguous memory allocation, it is allowed to store the processes in non-contiguous memory locations. There are different techniques used to load processes into memory, as follows: Paging Segmentation Virtual memory paging(Demand paging)   Paging Main memory is divided into a number of equal-sized blocks, are called frames. Each process is […]

Categories
Operating System

Partition Selection policy & Fragmentation

Partition Selection policy: Partition Selection policy, When the multiple memory holes (partitions) are large enough to contain a process, the operating system must use an algorithm to select in which hole the process will be loaded. The partition selection algorithm is as follows: First-fit:  The OS looks at all sections of free memory. The process […]

Categories
Operating System

Memory Allocation

Memory Allocation   Memory allocation, The main memory must accommodate both the operating system and the various user processes. We need to allocate different parts of the main memory in the most efficient way possible. The main memory is usually divided into two partitions: one for the resident operating system, and one for the user […]

Categories
Operating System

Logical- Versus Physical-Address Space

Logical- Versus Physical-Address Space Logical versus physical Address, The logical address is a virtual address. It can be viewed by the user. The user can’t see the physical address directly. The logical address is used as a reference, to access the physical address. An address generated by the CPU is commonly referred to as a logical […]

Categories
Operating System

Memory management

Memory Management Memory management,In a uni-programming system, main memory is divided into two parts: one part for the operating system (resident monitor, kernel) and one part for the user program currently being executed. In a multiprogramming system, the “user” part of memory must be further subdivided to accommodate multiple processes. The task of subdivision is […]

Categories
Operating System

Recovery From Deadlock

RECOVERY FROM DEADLOCK Recovery From Deadlock: -When a detection algorithm determines that a deadlock exists, then the system or operator is responsible for handling deadlock problem. There are two options for breaking a deadlock. Process Termination Resource preemption Process Termination There are two methods to eliminate deadlocks by terminating a process as follows: Abort all […]

Categories
Operating System

DEADLOCK DETECTION

DEADLOCK DETECTION Deadlock detection, If a system does not employ either a deadlock-prevention or a deadlock avoidance algorithm, then a deadlock situation may occur. In this environment, the system must provide: An algorithm that examines the state of the system to determine whether a deadlock has occurred. An algorithm to recover from the deadlock. According […]

Categories
Operating System

Safety Algorithm & Resource-Request Algorithm

Safety Algorithm The algorithm for finding out whether or not a system is in a safety algorithm can be described as follows: Let Work and Finish be vectors of length m and n, respectively. Initialize      Work := Available and Finisk[i] :=false for i = 1,2, …, n. Find an i such that both a. […]

Categories
Operating System

Banker’s algorithm

Banker’s algorithm The Banker’s algorithm is a resource allocation & deadlock avoidance algorithm developed by Edsger Dijkstra that test for safety by simulating the allocation of pre-determined maximum possible amounts of all resources. Then it makes a “safe-state” check to test for possible deadlock conditions for all other pending activities, before deciding whether allocation should […]

Categories
Operating System

Deadlock Avoidance

DEADLOCK AVOIDANCE Deadlock Avoidance approach to the deadlock problem anticipates deadlock before it actually occurs. This approach employs an algorithm to access the possibility that deadlock could occur and acting accordingly. If the necessary conditions for a deadlock are in place, it is still possible to avoid deadlock by being careful when resources are allocated. […]

Categories
Operating System

Deadlock Prevention

DEADLOCK PREVENTION Deadlock Prevention may be prevented by denying any one of the conditions. Prevent deadlock prevention by resource scheduling so as to negate at least one of the four conditions Elimination of “Mutual Exclusion” Condition: The mutual exclusion condition must hold for non-sharable resources. That is, several processes cannot simultaneously share a single resource. […]

Categories
Operating System

Resource Allocation Graph

Resource-Allocation Graph Deadlocks can be described in terms of a directed graph called a system resource-allocation graph. This graph consists of a set of vertices V and a set of edges E. The set of vertices V is partitioned into two different types of nodes P = {PI, P2, …, Pn}, the set consisting of […]

Categories
Operating System

Deadlocks

Deadlocks A set of the process is in a deadlocks state if each process in the set is waiting for an event that can be caused by only another process in the set. In other words, each member of the set of deadlock processes is waiting for a resource that can be released only by […]

Categories
Operating System

Monitors in Operating System

Monitors in Operation System Another high-level synchronization construct is the monitor type. A monitor is characterized by a set of programmer-defined operators. The representation of a monitor type consists of declarations of variables whose values define the state of an instance of the type, as well as the bodies of procedures or functions that implement […]

Categories
Operating System

The Dining Philosophers Problem

The Dining Philosophers Problem Consider five philosophers who spend their lives thinking and eating. The philosophers share a common circular table surrounded by five chairs, each belonging to one philosopher. In the center of the table is a bowl of rice, and the table is laid with five single chopsticks. When a philosopher thinks, she […]