Cooperative threading in a managed code execution environment
AssigneeMicrosoft Corporation
InventorsDavide Massarenti, Donald R. Thompson
Life of this patent
Estimating the term…
Abstract
A runtime execution environment may manage resources executing cooperative threading on a single physical thread. One example can scan eligible activation records linked to threads on a method process and can execute one of the activation records. This example can create a new activation record for a new method invoked for the executed activation record and link the new activation record to the executed activation record. Further, this example can loop back to re-start the method.
Claims12
A computer-implemented method for cooperative threading in an abstracted managed code execution environment, comprising:
- a) scanning, by at least one processor, a list of eligible activation records linked to a plurality of threads of a process, wherein the eligible activation records are stacked in order of execution priority, and wherein each activation record represents at least a state of one of the plurality of threads, the state including an identity of a function being called by the corresponding thread and a priority level;
- b) executing one of the activation records associated with a highest priority level;
- c) creating a new activation record for a new method invoked for the executing activation record, wherein the new activation record is not executed recursively;
- d) linking the new activation record to the list of eligible activation records;
- and
- e) repeating steps a)-d) for one or more other activation records in the list based on the priority level.
A computer-readable medium having executable instructions stored thereon that, when executed, cause one or more processors to perform a method for cooperative threading comprising:
- a) scanning a stack of activation records linked to a plurality of threads of a process, wherein eligible activation records are stacked in order of execution priority, wherein each activation record represents at least a state of one of the plurality of threads, the state including an identity of a function being called by the corresponding thread and the execution priority;
- b) executing an activation record having a highest execution priority;
- c) creating a new activation record for a new method invoked for the executing activation record, wherein the new activation record is not executed recursively;
- d) linking the new activation record to the stack;
- and
- e) repeating at least a) through d) for one or more other activation records in the stack based on the order of execution priority.
An apparatus, comprising:
- at least one processor, the processor capable of:
- scanning a list of activation records linked to a plurality of threads of a process, wherein the activation records are stacked in order of execution priority;
- executing an individual activation record having a highest execution priority among the stacked activation records linked to the plurality of threads, wherein each activation record represents at least a state of one of the plurality of threads, the state including an identity of a function being called by the corresponding thread and an execution priority;
- creating a new activation record for a method invoked by the executing activation record wherein the new activation record is not executed recursively;
- linking the new activation record to the stack of activation records corresponding to the executing activation record;
- suspending execution of the executing activation record;
- and
- scanning the of activation records for an activation record having a next highest execution priority.
Dependencies are inferred from the claim text.