Explain deadlock? What are necessary conditions for deadlock?

1 Answer

Answer :

In multiprogramming environment, several processes may compete for a finite number of resources. A process requests resources and if the resources are not available then the process enters into the waiting state. Sometimes a waiting process is never again able to change its status because the resources requested by it are held by other waiting processes. This situation is called as deadlock. When a process request for resources held by another waiting process which in turn is waiting for resources held by another waiting process and not a single process can execute its task, then deadlock occurs in the system. 

Example: Consider a system with three disk drives and three processes. When each process request one disk drive, system allocates one disk drive to each process. Now there is no more drive available in the system. If all three processes request for one more disk drive, then all three processes will go into the waiting state and system will go in deadlock state. Because any one process from the three can execute only when one of them will release the disk drive allocated to it.

Necessary Conditions:

1. Mutual exclusion: At least one resource must be held in a nonsharable mode; that is, only one process at a time can use the resource.

2. Hold and Wait: A process must be holding at least one resource and waiting to acquire additional resources that are currently being held by  other processes.

3. No pre-emption: Resources cannot be pre-empted i.e a resource can be released only voluntarily by the process holding it.

4. Circular wait: A set {P0,P1…Pn} of waiting processes must exist such that P0 is waiting for a resource held by P1,P1 is waiting for a resource held by P2,…,Pn-1 is waiting for a resource held by Pn and Pn is waiting for a resource held by P0. Each process is waiting for the resources held by other waiting processes in circular form.

Related questions

Description : Enlist different file allocation methods? Explain contiguous allocation method in detail.

Last Answer : From the user's point of view, a file is an abstract data type. It can be created, opened, written, read, closed and deleted without any real concern for its implementation. The implementation of a ... a times is difficult to estimate. 4. Compaction may be required and it can be very expensive.

Description : Explain LRU page replacement algorithm for following reference string. 7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1 Calculate the page fault.

Last Answer : LRU: The Least Recently Used (LRU) page replacement policy replaces the page that has not been used for the longest period of time. LRU replacement associates with each page the time of that page's last use. ... in question so assume frame size as 3 or 4) LRU: Assume frame size=3

Description : Explain multithreading model in detail.

Last Answer : Many systems provide support for both user and kernel threads, resulting in different multithreading models. Following are three multithreading model: Many-to-One Model The many-to- ... True concurrency cannot be achieved. Multiple threads of kernel is an overhead for operating system

Description : Enlist the operating system tools. Explain any two in detail.

Last Answer : Following are the operating tools: User Management Security policy Device Management Performance Monitor Task Scheduler A) User management: User management includes everything ... routing tables, interface statistics, masquerade connections, and multicast memberships. # netstat -tulpn

Description : Explain PCB with diagram.

Last Answer : Each process is represented as a process control block (PCB) in the operating system. It contains information associated with specific process. Process State: It indicates current state of a process. ... . Each PCB gives information about a particular process for which it is designed.

Description : Explain Round Robin algorithm with suitable example.

Last Answer : It is preemptive scheduling algorithm. A small unit of time known as a time quantum or time slice is used for pre-emption of a currently running process. Ready queue is implemented as a circular ... has received 1 time quantum, the CPU returns to process P1 for an additional time quantum. 

Description : Explain partitioning and its types.

Last Answer : An important operation of memory management is to bring programs into main memory for execution by the processor. Partitioning is a technique that divides a memory into multiple partitions. These partitions ... in memory. For example: Consider following table with process and memory space.

Description : With neat diagram explain inter process communication model.

Last Answer : Inter-process communication: Cooperating processes require an Interprocess communication (IPC) mechanism that will allow them to exchange data and information. There are two models of IPC 1. ... a communication link between them. Between each pair of processes exactly one communication link.

Description : List components of OS. Explain process management in detail.

Last Answer : List of System Components: 1. Process management 2. Main memory management 3. File management 4. I/O system management 5. Secondary storage management Process Management: The operating ... synchronization. 4. A mechanism for process communication. 5. A mechanism for deadlock handling.

Description : Enlist types of operating system. Explain multiprogramming OS in detail.

Last Answer : Types of operating system 1.Batch Systems 2.Multiprogramming 3.Multitasking 4.Time-Sharing Systems 5.Desktop Systems 6.Distributed system 7.Clustered system 8.Real Time system: Multiprogramming ... multiprogramming: user can open word, excel, access and other applications in a system.

Description : Explain any four scheduling criteria.

Last Answer : 1. CPU utilization: In multiprogramming the main objective is to keep CPU as busy as possible. CPU utilization can range from 0 to 100 percent. 2.Throughput: It is the number of processes ... fairly early and can continue computing new results while previous results are being output to the user.

Description : Explain any 4 services provided by OS.

Last Answer : 1.User Interface: All operating systems have a user interface that allows users to communicate with the system. Three types of user interfaces are available: a. Command line interface ( ... to system resources. Security is provided by user authentication such as password for accessing information.

Description : List any four features of open source operating system.

Last Answer : 1. Open Source: open source OS code is freely available and it is community based development project. Multiple team's works in collaboration to enhance the capability of operating system and it is ... issuing a command in Linux Terminal or Shell. Linux can also run Windows applications if needed.

Description : List free space management techniques? Describe any one in detail.

Last Answer : A file system is responsible to allocate the free blocks to the file therefore it has to keep track of all the free blocks present in the disk. There are mainly four approaches by using which, the free ... block. This block contains a pointer to the next free disk block, and so on.

Description : State and describe types of scheduler.

Last Answer : There are three types of scheduler: Long term scheduler Short term scheduler Medium term scheduler 1. Long term scheduler: It selects programs from job pool and loads them into the ... scheduler works in close communication with long term scheduler for loading process into the main memory. 

Description : What is purpose of system call? State two system calls with their functions.

Last Answer : System call provides an interface between a running program and operating system. It allows user to access services provided by operating system. This system calls are procedures written using C, ... send, receive messages transfer status information attach or detach remote devices. 

Description : Write Unix command for following: i)create a folder OSY ii) create a file FIRST in OSY folder iii) List/display all files and directories. iv) Write command to clear the screen

Last Answer : i) create a folder OSY: $mkdir OSY ii)create a file FIRST in OSY folder: $cd OSY $cat>FIRST or $ touch FIRST iii) List/display all files and directories: $ls iv) to clear screen: $clear

Description : Describe sequential and direct access method.

Last Answer : Sequential access: Information from the file is processed in order i.e. one record after another. It is commonly used access mode. For example, editors and compilers access files in sequence. A read ... prevent the user from accessing portions of the file system that may not be part of his file.

Description : Describe I/O Burst and CPU Burst cycle with neat diagram.

Last Answer : CPU burst cycle: It is a time period when process is busy with CPU.  I/O burst cycle: It is a time period when process is busy in working with I/O resources. A process execution consists ... cycle and so on. The final CPU burst cycle ends with a system request to terminate execution.

Description : Describe any four file attributes

Last Answer : File attributes: Name: The symbolic file name is the only information kept in human readable form. Identifier: File system gives a unique tag or number that identifies file within file ... Last modification and last use. These data can be useful for protection, security and usage monitoring.

Description : Write syntax for following commands: i)Sleep ii)Kill

Last Answer : i)sleep Syntax: sleep NUMBER[SUFFIX]… sleep OPTION ii) kill Syntax: kill pid

Description : Define virtual memory

Last Answer : Virtual memory is a memory management capability of an operating system (OS) that uses hardware and software to allow a computer to compensate for physical memory shortages by temporarily transferring data ... can be placed in overlays, but can concentrate instead on the problem to be programmed. 

Description : Draw process state diagram.

Last Answer : process state diagram

Description : Define real time operating system. List its any four applications of it.

Last Answer : Real time Operating System: A real time system has well defined fixed time constraints. Processing should be done within the defined constraints -Hard and Soft real time system. OR The ... Applications: 1. Flight Control System 2. Simulations 3. Industrial control 4. Military applications

Description : Necessary conditions for deadlock are: a) Non preemptive and circular wait b) Mutual exclusion and partial allocation c) Both of The Above d) None of The Above

Last Answer : b) are privileged calls that are used to perform resource management functions, which are controlled by the operating system

Description : The following conditions of policy must be present for a deadlock to be possible. i) Mutual exclusion ii) Hold and wait iii) No preemption iv) Circular wait A) i, ii and iii only B) ii, iii and iv only C) i, iii and iv only D) All i, ii, iii and iv

Last Answer : D) All i, ii, iii and iv

Description : What is a deadlock ? Explain .

Last Answer : Two processes wating to update the rows of a table which are locked by the other process then deadlock arises. In a database environment this will often happen because of not issuing ... when a commit/rollback operation performed or any one of this processes being killed externally.

Description : Explain the term ‘Deadlock’. State reason of occurance.

Last Answer : A deadlock is a situation where in two or more competing actions are each waiting for the other to finish, and thus neither ever does.  * Assume thread/process T1 has exclusive access to resource R1. ... P1 to Pn P1 waiting for the resource held by P2, P2 waiting for resource held by P3 etc.

Description : If Macedonia's current political deadlock led to political destabilization, would Serbia step in?

Last Answer : Not likely, but we like to stick our nose in everything, so….

Description : What is the procedure adopted for resolving deadlock -SST 10th

Last Answer : The Bill goes for assent to the President. If the President returns the Bill for its reconsideration and Parliament repassess it again, the President has to give his assent to the Bill and it is considered as passed.

Description : Prime Minister Attlee’s announcement on February 20, 1947, was attempted to end the deadlock in India and marked the last few months of British Rule. -SST 10th

Last Answer : The Congress and the Muslim League could not work together for long. The Muslim League went on harping on its demand for division of India. Jinnah said, We shall resist anything that militates ... one Government. (iii) Lord Mountbatten was to replace Lord Wavell as the new Viceroy of India.

Description : What is deadlock what is starvation How do they differ from each other?

Last Answer : A deadlock occurs when two (or more) threads have created a situation where they are all blocking each other. ... Starvation occurs when a scheduler process (i.e. the operating system) refuses to give a particular thread any quantity of a particular resource (generally CPU).

Description : In the case of deadlock between the two houses paraliament, the joint sitting is presided over by the: (1) President (2) Senior most member of Lok Sabha (3) Speaker of Lok Sabha (4) Vice President

Last Answer : (3) Speaker of Lok Sabha Explanation: Article 108 of Indian Constitution prescribes the procedure for resolving a conflict between the two Houses of Parliament over a Bill through a joint sitting' of both ... is presided over by the Speaker who is assisted by the Secretary-General of the Lok Sabha.

Description : Which are the method for handling deadlocks. a. Deadlock prevention b. Deadlock avoidance c. Deadlock detection d. Allof these

Last Answer : d. Allof these

Description : How many condition that should be met in order to produce a deadlock. a. 2 b 4 Cc. 6 d 8

Last Answer : b 4

Description : Which are the condition that should be met in order to produce a deadlock. a. Mutual exclusion b. Hold and Wait Cc. No preemption d. Circular wait e. Allofthese

Last Answer : e. Allofthese

Description : Which lock is more serious than indefinite postponement or starvation because it affect more than one job: a. Deadlock b. Spinelock c. Both d. None of these

Last Answer : a. Deadlock

Description : If the word ―resolution‖ in the story is to be replaced by another word, it would be (a) Prolonging (b) Continuation (c) Firmness (d) Deadlock

Last Answer : (c) Firmness

Description : What is NOT true about the tenure of the Speaker of the Lok Sabha? (a) He is no longer a Speaker if he ceases to be a member of the Lok Sabha due to any reason (b) When the Lok Sabha ... representative (d) When there's a deadlock in vote, the Speaker can cast his casting vote to break the deadlock

Last Answer : (b) When the Lok Sabha dissolves, the Speaker vacates his position simultaneously

Description : A direct method of deadlock prevention is to prevent the occurrence of ………….. A) Mutual exclusion B) Hold and wait C) Circular waits D) No preemption

Last Answer : C) Circular waits

Description : ……………. Can be defined as the permanent blocking of a set of processed that either complete for system resources or communicate with each other. A) Deadlock B) Permanent lock C) Starvation D) Mutual exclusion

Last Answer : A) Deadlock

Description : ………………. Techniques can be used to resolve conflicts, such as competition for resources, and to synchronize processes so that they can cooperate. A) Mutual Exclusion B) Busy Waiting C) Deadlock D) Starvation

Last Answer : A) Mutual Exclusion

Description : …………… is a condition in which there is a set of concurrent processes, only one of which is able to access a given resource or perform a given function at any time. A) Mutual Exclusion B) Busy Waiting C) Deadlock D) Starvation

Last Answer : A) Mutual Exclusion

Description : Which of the following is not the approach to dealing with deadlock? A) Prevention B) Avoidance C) Detection D) Deletion

Last Answer : D) Deletion

Description : A direct method of deadlock prevention is to prevent the occurrences of ................... A) Mutual exclusion B) Hold and wait C) Circular waits D) No preemption

Last Answer : C) Circular waits

Description : Simplest way of deadlock recovery is (A) Roll back (B) Preempt resource (C) Lock one of the processes (D) Kill one of the processes

Last Answer : (D) Kill one of the processes

Description : Which of the following concurrency protocol ensures both conflict serializability and freedom from deadlock : I. 2-phase locking II. Time phase ordering (A) Both I & II (B) II only (C) I only (D) Neither I nor II

Last Answer : (B) II only

Description : Which of the following concurrency protocol ensures both conflict serializability and freedom from deadlock ? (a) 2-phase Locking (b) Time stamp - ordering (A) Both (a) and (b) (B) (a) only (C) (b) only (D) Neither (a) nor (b)

Last Answer : (C) (b) only

Description : Consider a system having ‘m’ resources of the same type. These resources are shared by three processes P1, P2 and P3 which have peak demands of 2, 5 and 7 resources respectively. For what value of ‘m’ deadlock will not occur? (A) 70 (B) 14 (C) 13 (D) 7

Last Answer : (B) 14

Description : The Network is overloaded with enormous data sent by many computers within the network. The inability of the network to deliver the data is termed as __________ . (1) Access control (2) Congestion (3) Error propagation (4) Deadlock

Last Answer : Congestion