Patent ID: 8051426

Claim:
An application virtual machine system, comprising at least one processor coupled to at least one computer-readable storage medium storing instructions executable by the at least one processor to implement: a receiver component configured to receive a computer program; and a runtime component configured to execute at least one co-routine specified by the program using operations including initiating execution of the at least one co-routine based on a call by a first caller to the at least one co-routine, placing the at least one co-routine in a suspended state by capturing a state, including all local and free variables, of the at least one co-routine, by defining a delegate object comprising a single method for maintaining a stack frame as a state of the delegate object, and maintaining the captured state of the at least one co-routine as the state of the delegate object, determining that the at least one co-routine has been called by a second caller different from the first caller, and based on determining that the at least one co-routine has been called by the second caller, resuming the at least one co-routine from the captured state maintained as the state of the delegate object.