Pergunta de entrevista da empresa JPMorganChase

Implement a deadlock in any programming language.

Resposta da entrevista

Sigiloso

18 de set. de 2014

I screwed this one up as I hadn't seen deadlocks in a while. Basically you need to start two threads which use two resources. Thread 1 should lock resource A and wait for resource B. Thread 2 should lock resource B and wait for resource A. Running both of these threads at the same time should cause a deadlock.