Patent ID: 8307368

Claim:
At a computer system including a processor and a memory, in a computer networking environment including a plurality of computing systems, a computer-implemented method for establishing an execution environment for executing activities in a continuation based runtime, the method comprising: an act of establishing an execution environment for executing activities in a continuation based runtime (CBR), wherein establishing the execution environment comprises instantiating an activity scheduler that is configured to perform the following: an act of scheduling an activity for execution in the CBR, wherein the scheduled activity is associated with one or more work items and unique context information corresponding to the work items, the scheduling including adding the one or more work items to an execution stack and tracking pending activity of the one or more work items to determine when the scheduled activity has reached at least one of a plurality of completed states; an act of resolving arguments and variables of the scheduled activity prior to invoking the scheduled activity using the scheduled activity's unique context; an act of determining, based on the scheduled activity's unique context, that the scheduled activity comprises at least one work item that is to be queued at the top of the execution stack; and based on the determination, an act of queuing the at least one work item to the top of the execution stack; and an act of executing the one or more work items of the scheduled activity as queued in the execution stack of the established execution environment in the CBR, including executing the one or more work items of the scheduled activity without process affinity, by at least: executing a particular work item of the scheduled activity on a first process; pausing execution of the particular work item; and subsequent to pausing execution of the particular work item, resuming execution of the particular work item on a second, different, process.