0% found this document useful (0 votes)
91 views

Chapter 5: Memory Management: The Ostrich Algorithm

Detection and Recovery is a technique where the system monitors requests and releases of resources and updates the resource graph. If a cycle exists, indicating a deadlock, one of the processes in the cycle is killed to break the cycle. If killing one process does not break the deadlock, another process is killed until the cycle is broken. The Ostrich Algorithm is the simplest approach of ignoring the problem of deadlocks altogether. Most operating systems take this approach on the assumption that users prefer occasional deadlocks over strict restrictions limiting each process to one resource. This presents a trade-off between convenience and correctness when addressing deadlocks.

Uploaded by

suwask
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
91 views

Chapter 5: Memory Management: The Ostrich Algorithm

Detection and Recovery is a technique where the system monitors requests and releases of resources and updates the resource graph. If a cycle exists, indicating a deadlock, one of the processes in the cycle is killed to break the cycle. If killing one process does not break the deadlock, another process is killed until the cycle is broken. The Ostrich Algorithm is the simplest approach of ignoring the problem of deadlocks altogether. Most operating systems take this approach on the assumption that users prefer occasional deadlocks over strict restrictions limiting each process to one resource. This presents a trade-off between convenience and correctness when addressing deadlocks.

Uploaded by

suwask
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Detection and Recovery

A second technique is detection and recovery. When this technique is used, the system does not do anything except monitor
the requests and releases of resources. Every time a resource is requested or released, the resource graph is updated, and a
check is made to see if any cycles exist. If a cycle exists, one of the processes in the cycle is killed. If this does not break the
deadlock, another process is killed, and so on until the cycle is broken.
The Ostrich Algorithm
The simplest approach is the ostrich algorithm: stick your head in the sand and pretend there is no problem at all.[] Different
people react to this strategy in very different ways. Mathematicians find it completely unacceptable and say that deadlocks
must be prevented at all costs.
Most operating systems, including UNIX, MINIX 3, and Windows, just ignore the problem on the assumption that most
users would prefer an occasional deadlock to a rule restricting all users to one process, one open file, and one of everything.
If deadlocks could be eliminated for free, there would not be much discussion. The problem is that the price is high, mostly
in terms of putting inconvenient restrictions on processes. Thus we are faced with an unpleasant trade-off between
convenience and correctness, and a great deal of discussion about which is more important, and to whom. Under these
conditions, general solutions are hard to find.
Page:59 Compiled by: Daya Ram Budhathoki

Chapter 5: Memory Management


Types of Memory:
Primary Memory (eg. RAM)
Holds data and programs used by a process that is executing
Only type of memory that a CPU deals with
Secondary Memory (eg. hard disk)
Non-volatile memory used to store data when a process is not executing.
Memory Management:
Memory management is the act of managing computer memory. In its simpler forms, this involves providing ways to
allocate portions of memory to programs at their request, and freeing it for reuse when no longer needed. The management
Page:60 Compiled by: Daya Ram Budhathoki
Fig:Types of Memory management
Memory Management Scheme
Contiguous Memory
Allocation
Non-contiguous Memory
Allocation
Bare Machine
Segmentation
(User view)
Paging
(system view)
Variable Partition
Resident Memory
Multi
Programming
Fixed Partition
of main memory is critical to the computer system.
In a uniprogramming system, Main memory is divided into two parts:
– one part for the OS
– one part for the program currently being executed.
In a multiprogramming system, the user part of the memory must be further subdivided to accommodate multiple processes.
The task of subdivision is carried out dynamically by the Operating System and is known as Memory Management.
Two major schemes for memory management.
1.Contiguous Memory Allocation
2.Non-contiguous memory Allocation

1
Contiguous

You might also like