Skip to main content

Posts

Showing posts with the label Chapter 4

Answer Chapter 4

Question Definition 1.     What is resource? Answer Resource are device connected to a computer, internal system component is a resource, Files, Network connections and Memory areas. 2.     Explain concept of resource management. Answer a.     Modern computers consist of processors, memories, timers, disks, mice, network interfaces, printers, and a wide variety of other devices. In the alternative view, the job of the operating system is to provide for an orderly and controlled allocation of the processors, memories, and input/output devices among the various programs competing for them. b.     When a computer (or network) has multiple users, the need for managing and protecting the memory, input/output devices, and other resources is even greater, since the users might otherwise interface with one another. In addition, users often need to share not only hardware, but information (files, databases, etc.) ...

Example Of Deadlock In Operating System

Before we discuss about the example of DEADLOCK. We need to know what is DEADLOCK? DEADLOCK is a set of processes is in a deadlock state if every process in the set is waiting for an event (release)  that can only be caused by some other process in the same set. A deadlock is a situation in which two computer programs sharing the same resource are effectively preventing each other from accessing the resource, resulting in both programs ceasing to function. The earliest computer operating systems ran only one program at a time   The earliest computer operating systems ran only one program at a time. All of the resources of the system were available to this one program. Later, operating systems ran multiple programs at once, interleaving them.   Programs were required to specify in advance what resources they needed so that they could avoid conflicts with other programs running at the same time. Eventually some operating systems offered dyna...

Definition of Deadlock In Operating System

Deadlock in operating system A set of process is in a deadlock 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 a deadlock process. None of the processes can run, none of them can release any resources, and none of them can be awakened. It is important to note that the number of processes and the number and kind of resources possessed and requested are unimportant. The resources may be either physical or logical. Examples of physical resources are Printers, Tape Drivers, Memory Space, and CPU Cycles. Examples of logical resources are Files, Semaphores, and Monitors. Example: The simplest example of deadlock is where process 1 has been allocated non-shareable resources A, say, a tap drive, and process 2 has be allocated non-shareable resource B, say, a printer. Now, if it turns out that proc...

Deadlock condition

Conditions for a Deadlock To Occur No Preemption : no resource can be forcibly removed from a process holding it.If a process that is holding some resources requests another resource that cannot be immediately allocated to it, then all resources currently being held are released implicitly. Then the preempted resources are added to the list of resources for which the process is waiting.  Circular Wait : a closed chain of processes exists, such that each process holds at least one resource needed by the next process in the chain. Circular wait condition applies, since each vehicle is waiting on the next vehicle to move. That is, each vehicle in the traffic is waiting for a section of street held by the next vehicle in the traffic.