Patent ID: 7500247

Claim:
A machine-readable storage medium comprising instructions which, when executed, cause a machine to: executing a code and transferring a flow control between multiple agents including a first agent and a second agent while the code is being executed, wherein the instructions when executing the code further cause the machine to store data on a first call stack, the first call stack corresponding to and being used by the first agent, wherein the transferring of the flow control is performed between the first agent and the second agent such that not more than a single agent of the first and second agents is in control of the first call stack, wherein the transferring of the flow control is independent of types of the multiple agents; suspend the first agent's use of the first call stack; enable the second agent to access the data by using the first call stack, wherein the enabling of the second agent includes sending a signal to the second agent to begin using the first call stack, and receiving a signal from the second agent indicating that the second agent is no longer using the first call stack; resume the first agent's use of the first call stack after the second agent is no longer using the first call stack; maintain a usage count associated with the second agent, terminate the second agent when the usage count reaches zero, selectively increment the usage count when the second agent begins using the first call stack, and selectively decrement the usage count when the second agent is no longer using the first call stack; and provide results of the execution of the code via a display device.