Skip to content

Allow for better parallelization with brokered services#82733

Open
jasonmalinowski wants to merge 1 commit intodotnet:mainfrom
jasonmalinowski:allow-better-parallelization
Open

Allow for better parallelization with brokered services#82733
jasonmalinowski wants to merge 1 commit intodotnet:mainfrom
jasonmalinowski:allow-better-parallelization

Conversation

@jasonmalinowski
Copy link
Member

@jasonmalinowski jasonmalinowski commented Mar 12, 2026

By default, there is a SynchronziationContext set that ensures that when dispatching new RPC requests, a new RPC requests is not dispatched until the previous request either finishes, or awaits to yield the thread. Although there are some cases where we do need behavior like that (LSP is the perfect example), we don't need that for brokered services.

By default, there is a SynchronziationContext set that ensures that
when dispatching new RPC requests, a new RPC requests is not dispatched
until the previous request either finishes, or awaits to yield the
thread. Although there are some cases where we do need behavior like
that (LSP is the perfect example), we don't need that for brokered
services.
@jasonmalinowski jasonmalinowski self-assigned this Mar 12, 2026
@jasonmalinowski jasonmalinowski requested a review from a team as a code owner March 12, 2026 21:56
// The default synchronization context set by the base type is NonConcurrentSynchronizationContext, which means that all incoming calls
// would be processed sequentially, at least up until their first await. We generally don't have services that expect ordering in that specific way, so
// disable that, especially since we want CPU-bound operations to happen in parallel.
jsonRpc.SynchronizationContext = null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this apply to all brokered service usages - or just devenv -> oop? (e.g. does this apply to vscode brokered services)

Copy link
Member Author

@jasonmalinowski jasonmalinowski Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dibarbet As best I know, everything, VS Code included.

@jasonmalinowski
Copy link
Member Author

/pr-val

@github-actions
Copy link
Contributor

View PR Validation Run triggered by @jasonmalinowski

Parameters
  • Validation Type: pr-val
  • Pipeline ID: 8972
  • Pipeline Version: main
  • PR Number: 82733
  • Commit SHA: 5e89729f0a5bedf81053392a6e9a4f0e0f4cb075
  • Source Branch: allow-better-parallelization
  • Target Branch: main
  • Build ID: 13538539

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants