Skip to content

Reenable concurrent OOP sync sharing.#60758

Merged
CyrusNajmabadi merged 10 commits intodotnet:mainfrom
CyrusNajmabadi:reenableConcurrentSync
Apr 15, 2022
Merged

Reenable concurrent OOP sync sharing.#60758
CyrusNajmabadi merged 10 commits intodotnet:mainfrom
CyrusNajmabadi:reenableConcurrentSync

Conversation

@CyrusNajmabadi
Copy link
Copy Markdown
Contributor

@CyrusNajmabadi CyrusNajmabadi commented Apr 14, 2022

The new design pushes the concurrency detection to the host instead. On hte host side, we look to see if we're concurrently making feature requests for the same solution checksums. If so, those concurrent features share the same PinnedSolutionInfo and Scope objects (in a ref counted fashion so that they stay alive as long as any of the requests is still in flight).

Then, on the OOP side, we just have a mapping from ScopeId to the in-flight operation to sync it. Any OOP operations that then are working on the same scope-Id (which means they're sharing the same pinned info on the host side) can then share teh same sync operation on the OOP side.

This is safe as hte host side can only clean up if all concurrent features on the same checksum cancel/finish. Only then does the pinned scope on the host side go away. But tahts' ok as all the features on the OOP side that might care are themselves cancelled/finished.

Note: @dibarbet suggested a nice simplification where we no longer use scope-ids, but instead use solution-checksums. That change will come in a follow-up PR to keep things simple here.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner April 14, 2022 21:41
@ghost ghost added the Area-IDE label Apr 14, 2022
internal partial class SolutionAssetStorage
{
internal readonly struct Scope : IDisposable
internal class Scope : IDisposable
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

needs to be a class to use ReferenceCountedDisposable.

@CyrusNajmabadi CyrusNajmabadi requested a review from dibarbet April 14, 2022 23:58
@CyrusNajmabadi
Copy link
Copy Markdown
Contributor Author

i'm going to wait on merging htis until we insert the fix in #60753

@CyrusNajmabadi CyrusNajmabadi merged commit 4814028 into dotnet:main Apr 15, 2022
@CyrusNajmabadi CyrusNajmabadi deleted the reenableConcurrentSync branch April 15, 2022 17:29
@ghost ghost added this to the Next milestone Apr 15, 2022
@dibarbet dibarbet modified the milestones: Next, 17.3.P1 Apr 25, 2022
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