1. A method comprising: placing an executable thread of instructions in an inactive state in response to a resource being unavailable; when the resource becomes available, changing the thread of instructions to the active state and granting the resource to the thread of instructions; and releasing the thread, in response to the thread finishing with the resource, only if the thread is not dependent on any subsequent thread.