I really need your help on this.
What is deadlock? Can someone explain to me in the simplest form what is deadlock in operating systems. How can a process be deadlocked or not. pls. give me examples of resource allocation graph then explain ..

I've been reading about deadlocks quite often but still it is unclear to me. I hope someone is kind enough to help me with this.

Recommended Answers

All 4 Replies

Deadlock occurs when you have two or more processes are waiting for the other to finish, so none of them do.

When several processes are waiting for another to finish so none do. Livelock can also occur and is the opposite When two processes constantly give each other access so neither get the resources required.

I just wanna ask.
if p1 requested for r1 which is assigned for p2 which waits for nothing. Is p2 released? and then r1 can now be used by p1.therefor no deadlock.

am i right?

technically p2 isn't released since it is never held up (as it isn't waiting for anything as you said). But otherwise, yes you are correct, that doesn't result in a deadlock.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.