Allow for better parallelization with brokered services#82733
Open
jasonmalinowski wants to merge 1 commit intodotnet:mainfrom
Open
Allow for better parallelization with brokered services#82733jasonmalinowski wants to merge 1 commit intodotnet:mainfrom
jasonmalinowski wants to merge 1 commit intodotnet:mainfrom
Conversation
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.
dibarbet
approved these changes
Mar 12, 2026
| // 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; |
Member
There was a problem hiding this comment.
Does this apply to all brokered service usages - or just devenv -> oop? (e.g. does this apply to vscode brokered services)
Member
Author
There was a problem hiding this comment.
@dibarbet As best I know, everything, VS Code included.
Member
Author
|
/pr-val |
Contributor
|
View PR Validation Run triggered by @jasonmalinowski Parameters
|
drewnoakes
approved these changes
Mar 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.