Posts

Showing posts from December, 2019

Memory Management

Image
                        Memory Management Memory management is the functionality of an operating system which handles or manages primary memory and moves processes back and forth between main memory and disk during execution. Memory management keeps track of each and every memory location, regardless of either it is allocated to some process or it is free. It checks how much memory is to be allocated to processes. It decides which process will get memory at what time. It tracks whenever some memory gets freed or unallocated and correspondingly it updates the status. This tutorial will teach you basic concepts related to Memory Management. Process Address Space The process address space is the set of logical addresses that a process references in its code. For example, when 32-bit addressing is in use, addresses can range from 0 to 0x7fffffff; that is, 2^31 possible numbers, for a total theoretical size of 2 gigabytes. The operating system takes care of mapping the logical

Deadlocks

Image
                                Deadlocks Introduction of Deadlock  A process in operating systems uses different resources and uses resources in following way. 1) Requests a resource 2) Use the resource 2) Releases the resource Deadlock  is a situation where a set of processes are blocked because each process is holding a resource and waiting for another resource acquired by some other process. Consider an example when two trains are coming toward each other on same track and there is only one track, none of the trains can move once they are in front of each other. Similar situation occurs in operating systems when there are two or more processes hold some resources and wait for resources held by other(s). For example, in the below diagram, Process 1 is holding Resource 1 and waiting for resource 2 which is acquired by process 2, and process 2 is waiting for resource 1. Deadlock can arise if following four conditions hold simultaneously (Necessary Conditions