Skip to content

Simplify how we handle event change notifications in tagging#60488

Merged
CyrusNajmabadi merged 6 commits intodotnet:release/dev17.3from
CyrusNajmabadi:taggerSimplification
Mar 31, 2022
Merged

Simplify how we handle event change notifications in tagging#60488
CyrusNajmabadi merged 6 commits intodotnet:release/dev17.3from
CyrusNajmabadi:taggerSimplification

Conversation

@CyrusNajmabadi
Copy link
Copy Markdown
Contributor

This makes a few changes to simplify things. Instead of manually chaining an unbounded list of Tasks, we instead use a simple async-batching-work-queue. This queue has at most one executing task and one 'queued' task representing hte next piece of work to do.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner March 30, 2022 22:30
@ghost ghost added the Area-IDE label Mar 30, 2022
/// </summary>
private readonly AsyncBatchingWorkQueue<NormalizedSnapshotSpanCollection> _normalPriTagsChangedQueue;

private readonly ReferenceCountedDisposable<TagSourceState> _tagSourceState = new(new TagSourceState());
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.

this basically just needed to wrap a CTS + queue in a threadsafe fashion. However, we can just use a normal AsyncBatchingWorkQueue (already threadsafe) and pull the CTS up to here. we can be threadsafe on the CTS as all the places that use it already have a place they run on the UI thread, so they can be appropriately safe wrt to DIsposal (also on the UI thread).

@CyrusNajmabadi CyrusNajmabadi merged commit 815eee5 into dotnet:release/dev17.3 Mar 31, 2022
@CyrusNajmabadi CyrusNajmabadi deleted the taggerSimplification branch April 4, 2022 19:21
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.

3 participants