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

Move to a semaphoreslim in the workspace. #51215

Closed
wants to merge 2 commits into from

Conversation

CyrusNajmabadi
Copy link
Member

Pulled out from #51138 for independent review.

@@ -199,7 +199,7 @@ public async Task InitializeUIAffinitizedServicesAsync(IAsyncServiceProvider asy
var openFileTracker = await OpenFileTracker.CreateAsync(this, asyncServiceProvider).ConfigureAwait(true);

// Update our fields first, so any asynchronous work that needs to use these is able to see the service.
lock (_gate)
using (_gate.DisposableWait())
Copy link
Member

Choose a reason for hiding this comment

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

Why not DisposableWaitAsync?

Copy link
Member Author

Choose a reason for hiding this comment

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

was initially making just a straight translation. but we can def update tehse calls to be DisposableWaitAsync as well .

Copy link
Member

@sharwell sharwell left a comment

Choose a reason for hiding this comment

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

How confident are we that reentrancy is impossible?

@CyrusNajmabadi
Copy link
Member Author

How confident are we that reentrancy is impossible?

Not at all confident. I've already found one case of reentrancy. Though, IMO, these cases are boken as well. In cases of non-virtual calls, it's clear what the right code is. In the case of virtuals, it's not at all clear given that we might have subclasses doing strange things. So definitely concerning.

Base automatically changed from master to main March 3, 2021 23:53
@CyrusNajmabadi
Copy link
Member Author

CLosing out for now. I don't feel this can be done particularly safely. We have reentrancy, and there is a lot of virtual calls here that make it difficult to ensure the same behavior and now risk of deadlocks.

@CyrusNajmabadi CyrusNajmabadi deleted the asyncWorkspace branch July 24, 2024 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants