Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Responsiveness] Remove implicit RPC from background thread via unneeded GetServiceAsync extensions #10916

Closed
nkolev92 opened this issue Jun 4, 2021 · 0 comments · Fixed by NuGet/NuGet.Client#4090

Comments

@nkolev92
Copy link
Member

nkolev92 commented Jun 4, 2021

These IAsyncServiceProvider extension methods/overloads are unnecessarily, can increase thread-pool latency and should be deleted in lieu of the generic built-in extension methods from the SDK. Care should be taken to handle any behavior differences, such as these built-in extension methods throwing by default when the service does not exist.

Background:

These extension methods perform a cast on the result of IAsyncServiceProvider.GetServiceAsync, which if occurred on a background thread, can perform a blocking COM RPC to the UI thread for STA-bound objects, such as IVsSolution, DTE, etc. This will block a thread pool thread until the UI thread responds, decreasing the number of available threads, which in turn can lead to UI responsiveness issues[1]. The built-in overloads perform a non-blocking wait to the UI thread to perform the cast, and therefore do not suffer from this problem.

1336518

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

Successfully merging a pull request may close this issue.

1 participant