Patent ID: 9003377
Filing Date: 2015-04-07
Classification: G06F

Abstract:
1. A system comprising: a processor and a memory including a module configured to cause the processor to: suspend and resume co-routines comprising a calling co-routine and a called co-routine in a computer environment utilizing a single linear machine call stack not inherently capable of suspending and resuming co-routines, wherein only in response to detecting suspension of the called co-routine, the module: saves a resume-able portion of the single linear machine call stack not previously saved to a heap that emulates the single linear machine call stack but is separate from the single linear machine call stack such that the resume-able portion of the single linear machine call stack is only copied to the heap once, the resume-able portion of the single linear machine call stack comprising a stack frame for the calling co-routine, a stack frame for the called co-routine and a stack frame for a resumer; removes the resume-able portion of the single linear machine call stack from the single linear machine call stack; places a return address for a resumer that controls co-routine execution on the single linear machine call stack so that when the called co-routine is suspended it does not return to the calling co-routine but instead returns to the resumer; and in response to detecting resumption of the called co-routine: copies only the stack frame for the called co-routine onto the single linear machine call stack without copying all of the resume-able portion of the single linear machine call stack onto the single linear machine call stack.