Deadlock analysis and control in resource allocation systems