Skip to content

AbstractSimplificationService.ReduceAsync calls Task.WaitAll #478

Description

@AArnott

Async methods should not unnecessarily block threads (UI thread or otherwise). This method delegates to a synchronous Reduce method which calls Task.WaitAll.

It appears Task.WaitAll takes a CancellationToken whereas Task.WhenAll does not offer that option. I see Roslyn is passing in a CancellationToken so that may be why WaitAll was chosen. However there are better ways to combine cancellation and async code.

I'll prepare a pull request for this fix.

Ported from https://roslyn.codeplex.com/workitem/471

Activity

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions