Detecting And Protecting Deadlock Ranks