Domanda di colloquio di AMD

What is deadlock? How does semaphore work?