-
Notifications
You must be signed in to change notification settings - Fork 51
Worker Process Remoting
For Visual Studio 2019, Concord was extended to be able to load additional components outside of the IDE process. This technology is named Worker Process Remoting. Worker Process Remoting allows Concord components which previously had to be loaded into the IDE process (devenv.exe) to now be loaded in a separate 64-bit process. This allows these components to take advantage of the additional virtual and physical memory resources that the computer has instead of being constrained to the 4 gigabytes of shared address space that the devenv.exe process is constrained to. The primary use of Worker Process Remoting is to load components that make significant use of C/C++ symbols, such as the C++ symbol provider, and the C++ expression evaluator, into a separate process.
Worker Process Remoting is just for IDE-side components, that is components with a component level which is larger than 100,000. It builds off the 'standard' remoting support that Concord has had since the beginning, but it lifts some of the restrictions that regular remoting has. For example, in regular remoting, many Dkm objects (ex: DkmProcess) intentionally cannot be created in one remote debugger process and marshalled to another remote debugger process.
The main class for worker process remoting in the Concord API is Microsoft.VisualStudio.Debugger.DefaultPort.DkmWorkerProcessConnection.
If you own a component, and you want to have it start loading in a worker process you need to take a few steps:
1: Set WorkerProcessSupported="true"
in your .vsdconfigxml file. Example:
<Class Name="CMyNativeClass" ClassId="{504A0631-514F-4EB8-AFA5-C7F682F895F7}" WorkerProcessSupported="true">
<Implements>
<InterfaceGroup>
2: If necessary - split your class up
Concord doesn't allow all IDE side interfaces to be implemented in worker processes. If step 1 resulted in errors from the VSDConfigTool about implementing interfaces which aren't supported in worker processes you will need to refactor your class into multiple classes - one class which is loaded into the worker process, and another class which will always load into the IDE. These classes can communicate with each other using custom messages (DkmCustomMessage).
In addition to implementing IDE-only interfaces, there are also a few other cases where this refactoring may be necessary:
- If your component consumes APIs that are only callable from the IDE process. An example of such an API is DkmMainVsThread.Invoke. APIs will generally fail with code
E_XAPI_METHOD_UNAVAIL_IN_WORKER_PROCESS
. - If you need to immediately be notified of events (implement a 'IDkmReceived' or 'IDkmNotification' interfaces). Unlike in the IDE, events that originate in the IDE (or monitor) will not be immediately dispatched to the worker process but rather this notification is deferred until the next call between the IDE and the worker process.
3: If your component is implemented in native C++, you need to make sure that your extension includes both an x86 and an x64 implementation of your component, and any of its dependencies. See here for more information.
Concord Documentation:
- Overview
- Visual Studio 2022 support
- Concord Architecture
- Getting troubleshooting logs
- Tips for debugging extensions
- Component Discovery and Configuration
- Component Levels
- Navigating the Concord API
- Obtaining the Concord API headers, libraries, etc
- Concord Threading Model
- Data Container API
- Creating and Closing Objects
- Expression Evaluators (EEs)
- .NET language EEs
- Native language EEs
- Installing Extensions
- Cross Platform and VS Code scenarios:
- Implementing components in native code:
- Worker Process Remoting
Samples: