Dead-Lock is occurred in multiple users Computing Environment. As we know that there is Many Number of users those are going to perform their Transactions. Dead-Lock has occurred when two or More Users are requesting for data item or for a Resource of System for example two or more users Request for the Printers at a Same Time and When Dead-Lock has occurred.
All the users will be on Wait State Means, No user can get the resource of the System. Or Dead-Lock is occurred when two or More Requests are waiting for Some Operation Which is not possible. There is also Some Situation When the Problem of Dead Lock has occurred. There are Following Conditions for a Deadlock has Occur:-
1) Circular Wait:- When two or More Requests are Waiting For a Long Period of Time and no one can Access the Resource from the System Resources , Then this is called as Circular Wait For Example if two or more users Request for a Printer, at a Same Time , they Request to Print a Page. Then they will be on the Circular Wait. Means System Will Display Busy Sign of Sign.
2) Partial Allocation: - After Processing the Request, if a user doesn’t leave the Resource of the System, then we cant use the Resource of the System. Then in this Situation when the other users, Request for the Resource then the other users, will also be on the Waiting State. Then this will create the Deadlock.
3) Mutual Exclusive:- When a Single Process is used by two or more Processes, Means a Single Resource if used for performing the two or more activities as a Shared Based. But this is will Also Create a Problem because when a Second user Request for the System Resource which is being used by the user.
4) HOLD and Wait:- A Single Process may need two or more System Resources. And suppose if a Process have a Single Resource, and he is waiting the Second Resource. Then Process can’t Leave the first Resource and waiting for the Second Resource. So that there will also be the Condition of Deadlock.
5) No Preemption:- if there is no Rule to use the System Resources. Means if all the System Resources are not allocated in the Manner of Scheduling. Then this will also create a Problem for a Deadlock because there is no surety that a Process will Release the System Resources after the Completion. So Preemption and Transaction Rollback prevents Deadlock situation.
For Avoiding a Dead Lock First of all we have to detect Dead-Lock Means Firstly we have to detect why and how a Deadlock has occurred and Then Avoid or Solve the Problems those are Occurred due to Occurrence of Deadlock.
Related Articles on Operating System