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

1 Answer

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.

* Thread/ process T2 has exclusive access to resource R2. 

* If T1 needs exclusive access to R2 and T2 needs exclusive access to R1,

* Neither thread can continue.

* They are deadlocked. 

The simplest example is that of two tasks: 1 and 2. Each task requires two mutexes: A and B. If Task 1 takes mutex A and waits for mutex B while Task 2 takes mutex B and waits for mutex A, then each task is waiting for the other to release the mutex.: 

These tasks may run without problems for a long time, but eventually one task may be preempted in between the wait calls, and the other task will run. In this case, Task 1 needs mutex B to be released by Task 2, while Task 2 needs mutex A to be released by Task 1. Neither of these events will ever happen.

image

Causes of Deadlock

Mutual exclusion: only one process at a time can use a resource

Hold and wait: A process holding at least one resource is waiting to acquire additional resources held by other resources

No preemption: A resource can be released only voluntarily by the process holding it after that process has completed the task

Circular wait: A set of processes- P1 to Pn …P1 waiting for the resource held by P2, P2 waiting for resource held by P3 etc.

Related questions

Description : Ability of a gene to express more than one characters is called Pleiotropy. ! The occurance of a bacterium in more than one morphological forms is cal

Last Answer : Ability of a gene to express more than one characters is called Pleiotropy. ! The occurance of a bacterium ... wrong D. If both As and R are wrong.

Description : Rewrite the given statements in their order of occurance: (i) 18 Grenadiers probed to scout for suitable routes for the assault.

Last Answer : Rewrite the given statements in their order of occurance: (i) 18 Grenadiers probed to ... Projected Mission Tiger Hill as a national challenge.

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 : 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 deadlock? What are necessary conditions for deadlock?

Last 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 ... Each process is waiting for the resources held by other waiting processes in circular form.

Description : Explain the need to consider following factors in design matrix of embedded system: (i) Processor (ii) Memory (iii) Power (iv) Non- recurring engineering cost.

Last Answer : 1. Processor: Selection of processor depends upon amount of processing power and the register width required. Powerful 8bit, 16 bit, 32 bit & 64bit processors are available. The clock speed ... system is designed any number of units can be manufactured without incurring any additional design cost.

Description : State two examples of RTOS.

Last Answer : 1. LynxOS. 2. OSE. 3. QNX. 4. RTLinux. 5. VxWorks. 6. Windows CE.

Description : State the use of MAX 232 in communication.

Last Answer : MAX 232 is line driver that converts from RS232 voltage levels to TTL voltage levels & vice versa in serial communication 

Description : State four advantages of embedded system. 

Last Answer : 1) Design and Efficiency 2) Cost 3) Accessibility 4) Maintenance 5) Redundancies

Description : State the methods of task synchronization. Describe semaphore with suitable example.

Last Answer : The methods of task synchronization are: Semaphore Message queue. Mutual exclusion.  Dead lock. Mailboxes. Message Queues. Semaphores: It is a system of sending message by using flags. Multiple concurrent threads of execution ...   signal(Sem);  }  in process P2  {  wait(Sem);  S2;  }

Description : State four features of Zigbee.

Last Answer : Zigbee features (any4):- IEEE Standard 802.15.4 Frequency (GHz) 0.868, 0.915, 2.4 Maximum bit rate (Mbps) 0.250 or 250 Kbps, low bit rate Typical data throughput (Mbps) 0.2 ... Range (Meters) 10-100 Relative Power Consumption Very low Battery Life Months to years Network Size 64,000+ 

Description : State any four features of IDE.

Last Answer : Features of IDE 1) IDE normally consists of source code editor, a compiler, build automation tools and debugger. 2) It supports for defining a processor family and its version. 3) ... 4) Provides multiuser environment. 5) Supports conditional and unconditional break points. 6) Provides debugger.

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 : 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 : 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 : 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 : ……………. 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

Description : Compare synchronous and asynchronous communication.

Last Answer : Synchronous communication Asynchronous communication Single clock is used for both transmitter and receiver Two different clocks are used for both transmitter and receiver Data bits are transmitted ... Character is received at a any rate Less reliable More reliable

Description : Write a C language program to operate port 0 and port 2 as output port and port 1 and port 3 as input port.

Last Answer : #include void main (void ) { unsigned char X,Y P0=0X00; // P0 as output port P2=0X00;// P2 as output port P1=0XFF;//P1 as input port P3=0XFF;// P3 as input port while(1) { X= P1; Y=P3; P0=X; P2=Y; }//end of while }//end of main

Description : Compare features of PIC and AVR microcontrollers

Last Answer : Parameters PIC AVR Bus width 8/16/32-bit 8/32-bit Communication Protocols UART, USART, LIN, CAN, Ethernet, SPI, I2C UART, USART, SPI, I2C, (special ... Average Atmel Popular Microcontrollers PIC18fXX8, PIC16f88X, PIC32MXX Atmega8, 16, 32, Arduino Community

Description : Sketch pin-out diagram of LM35 and label its pin.

Last Answer :  pin-out diagram of LM35 and label its pin

Description : Develop a ‘C’ program to transfer the data from port P0 to port P1.

Last Answer : #include void main (void ) { unsigned char X; P0=0XFF; // P0 as input port P1=0X00;//P1 as output port while(1) //do forever { X = P0;//read port0 P1 = X;// output data to port1 }

Description : List out four types of embedded systems.

Last Answer : 1. Small Scale Embedded Systems 2. Medium Scale Embedded Systems 3. Sophisticated Embedded Systems 4. Stand Alone Embedded Systems 5. Real Time Embedded Systems 6. Networked Embedded Systems 7. Mobile Embedded Systems

Description : Draw the block diagram of an embedded system and describe the hardware units of an embedded system.

Last Answer : OR Explanation: The embedded system consist of different components embedded into it as follows: 1) Embedded Processor 2) Power supply , reset and Oscillator circuits 3) System timers 4) ... to store data and program. Following are types of memories used in embedded system.

Description : Draw the labeled interfacing diagram to interface relay with 89C51 microcontroller.

Last Answer : the labeled interfacing diagram to interface relay with 89C51 microcontroller

Description : What is multicore processor? Describe in brief.

Last Answer : Multicore Processor: It is an integrated circuit in which two or more processors core have been packaged for enhanced performance, reduced power consumption and more efficient simultaneous ... Multicore processors will give the benefits to all software especially for multithreaded program.

Description : Distributed under Creative Commons Attribution-ShareAlike - CC BY-SA.

Last Answer : The time required to develop a system to the point that it can be released and sold to customers. The main contributors are design time, manufacturing time, and testing time. This metric has become ... early can make a big difference in the system's profitability. Version 2 EE IIT, Kharagpur

Description : Distributed under Creative Commons Attribution-ShareAlike - CC BY-SA.

Last Answer : Hard drives have two kinds of components: internal and external. External components are located on a printed circuit board called logic board while internal components are located in a sealed chamber called HDA or Hard ... that a Hard Disk Drive is an RTES.  Version 2 EE IIT, Kharagpur 

Description : Distributed under Creative Commons Attribution-ShareAlike - CC BY-SA.

Last Answer : The Performance Design Metric Performance of a system is a measure of how long the system takes to execute our desired tasks. The two main measures of performance are:  Latency or ... the available processors rather than going for a custom design.  Version 2 EE IIT, Kharagpur 

Description : Distributed under Creative Commons Attribution-ShareAlike - CC BY-SA.

Last Answer : Design Metrics  A Design Metric is a measurable feature of the system's performance, cost, time for implementation and safety etc. Most of these are conflicting requirements i.e. optimizing one ... test circuitry to check that manufacturing was correct.  Version 2 EE IIT, Kharagpur

Description : Distributed under Creative Commons Attribution-ShareAlike - CC BY-SA.

Last Answer : Components of an Embedded System   By this time we know where are our Embedded Systems and what makes them stand out from other systems like Calculators, Desktop Computers, and our Old Television ... account the technical as well as economic considerations.  Version 2 EE IIT, Kharagpur

Description : Distributed under Creative Commons Attribution-ShareAlike - CC BY-SA.

Last Answer : Structure and Design Instructional Objectives  After going through this lesson the student will  Learn more about the numerous day-to-day real time embedded systems  Learn the ... data such as phone numbers, calendars information, games etc.  Version 2 EE IIT, Kharagpur