Answer:
The OS deals with such deadlock to temporarily prevent resources from deadlocked processes. It is either it back off a process to some check point allowing preemption of a needed resource and restarting the process at the checkpoint later. Finally, successively kill processes until the system is deadlock free.