Skip to main content

What is a deadlock?

Junior C#
Quick Answer Deadlock is when two or more threads each hold a resource the other needs รขโ‚ฌโ€ so they all wait forever. Thread A holds Lock 1 and needs Lock 2; Thread B holds Lock 2 and needs Lock 1. Prevent by always acquiring locks in the same order, or using timeouts.

Answer

Deadlock occurs when multiple threads wait for each other's resources and none of them can continue.

S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice