Pergunta de entrevista da empresa Elastic

When does a deadlock occur?

Respostas da entrevista

Sigiloso

21 de jul. de 2017

When the locks are accessed in wrong order. Basically one thread picks lock A first and lock B after, while at the same time another thread picks lock B first and lock A after. This can be solved by comparing the participating objects system hashcodes and re-ordering the locks accordingly.

Sigiloso

21 de jan. de 2019

When a thread that has acquired an lock on a particular resources for its task execution and at the same time when an another thread wants to access the same resources for its task execution then at that situation deadlock occurs.

Sigiloso

16 de out. de 2019

This looks so good: bit.ly/faang100