Patent ID: 8032886

Claim:
A computer-readable storage device having stored thereon computer-executable instructions that, when executed by at least one processor, perform a method of tracking asynchronous execution of a program, the method comprising: receiving a user input comprising a definition of a hierarchical structure of objects that represents the asynchronous execution of the program; initializing a first task object in the hierarchical structure of objects, the first task object representing a task from the program; when the first task object is initialized, associating the first task object with a second task object via a reference to the second task object, wherein the second task object is a parent of the first task object in the hierarchical structure of objects, and initializing a task handler for performing at least one asynchronous operation associated with the task; and during execution of the task, suspending the execution of the task when the task handler calls at least one function to perform the at least one asynchronous operation, wherein the at least one asynchronous operation is represented as a child object of the first task object in the hierarchical structure of objects, wherein suspending the execution of the task comprises setting the state of the task to “pending on object deletion” and wherein the first task object further comprises a data field containing data representing an association of the first task object with an object on whose deletion the task is pending, when the at least one asynchronous operation is completed, resuming the execution of the suspended task by calling the task handler, based on the at least one function; wherein the second task object that is the parent of the first task object is associated with a reference counter, the reference counter is incremented when the first task object is initialized and associated with the second task object via the reference to the second task object; the method further comprising deleting the first task object when the reference counter is set to zero.