answersLogoWhite

0

1) An environment that allows more than one program to access the same set of variable.

2) The ability of a program to "sleep" until it can have (access) a varible.

3) The ability of a program to block other programs from having (accessing) a variable.

Dead Lock example:

Program GoodGosh and GoshDarn both access variables A and B by "Locking" the variables, doing some processing, and then releasing the variables. Both variables have to be obtained and locked before further processing and unlocking can occur.

While processing, Program GoodGosh acquries a lock on variable A and then attempts to acqure a lock on Varable B. Before GoodGosh can acquire variable B, Program GoshDarn acqures a lock on variable B. GoodGosh want B and owns A. GoshDarn owns A and wants B. Neither can process further until the other releases a variable. Deadlock now exists.

Note: To prevent deadlocks, all modules/programs that access the same set of variables should always acquire the variables in the same order.

User Avatar

Wiki User

17y ago

Still curious? Ask our experts.

Chat with our AI personalities

RafaRafa
There's no fun in playing it safe. Why not try something a little unhinged?
Chat with Rafa
ReneRene
Change my mind. I dare you.
Chat with Rene
BeauBeau
You're doing better than you think!
Chat with Beau

Add your answer:

Earn +20 pts
Q: What are the necessary condition for a deadlock?
Write your answer...
Submit
Still have questions?
magnify glass
imp