Execution Context Extension in Continuation Runtimes
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Continuation based runtimes lack efficient mechanisms to provide and manage execution properties within their execution contexts, limiting the flexibility and functionality of activities and their child activities.
Innovation Solution
A computer system instantiates a parent activity with child activities that can add execution properties to the execution context, and implements a thread-local store (TLS) interface for setup and cleanup, enabling the management of execution properties during activity execution, including setup before pulse of work and cleanup after execution.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If continuation based runtime uses standard thread-local storage for execution context, then thread identity and basic properties are maintained, but execution properties cannot be extended or customized for activities
Solution Approach 1:
The execution context is segmented into two distinct parts: the base execution context (inheriting from ThreadLocalExecutionContext) that handles standard thread properties, and an extended execution context (through IExecutionProperty implementation) that provides customized execution properties for activities. This segmentation allows independent management of standard and extended properties without interfering with each other.
Solution Approach 2:
The IExecutionProperty interface acts as an intermediary layer between the base execution context and the activity execution. It provides a standardized mechanism for adding, accessing, and managing extended execution properties without requiring changes to the underlying thread-local storage infrastructure.
2Adaptability or versatility
If execution properties are added to extend activity functionality, then activity flexibility increases, but context management complexity increases
Solution Approach 1:
The execution property mechanism is designed to be self-managing through automatic registration and retrieval. Activities can access execution properties through the standardized IExecutionProperty interface without manual context manipulation, and the runtime automatically handles the lifecycle of execution properties during activity execution.
Solution Approach 2:
The IExecutionProperty interface provides a universal mechanism that can accommodate any type of execution property needed by activities. The same interface structure handles diverse property types uniformly, simplifying management while enabling extensive functionality extension across different activity scenarios.
3Adaptability or versatility
If activities are paused and resumed in different processes or threads, then runtime flexibility improves, but execution context consistency becomes difficult to maintain
Solution Approach 1:
When activities are persisted to storage and later rehydrated, the execution context is copied and reconstructed in the new process or thread. The IExecutionProperty interface ensures that execution properties are properly serialized and restored, maintaining context consistency across process and thread boundaries through structured copying rather than direct sharing.
Data Source
AI summary
In an embodiment, a computer system instantiates a parent activity configured for execution in a continuation based runtime. The parent activity includes various child activities configured to perform pulses of work. The parent activity is also configured to add execution properties to an execution context. The computer system adds execution properties to the parent activity's execution context to generate a modified execution context which includes execution properties that extend the functionality of the parent and child activities. The added execution properties include corresponding identifiers that identify the added execution properties. The computer system also executes the parent activity including the various child activities within the modified execution context in the continuation based runtime. The modified execution context includes the added execution properties that are available to the parent and any child activities during execution, where at least one child activity implements functionality provided by the added execution properties.


