What conditions cause a deadlock, and how do you deal with it?

3 stars If you are short on time, start with this one.

In one or two sentences
Several tasks wait forever for resources held by each other. It happens when mutual exclusion, hold and wait, no preemption and circular wait all hold at once.

Think of your own answer first

Say it out loud, or type it below. What you type never leaves this device.

Follow-up questions

These are likely next questions from an interviewer. Think of your answer first, then press the button.

  1. 1 / 3

    How is deadlock different from starvation?

Sources checked

This is a textbook level concept, so no outside source is listed.