Skip to content

Is VSTHRD011 (Use AsyncLazy<T>) missing from AppWithoutMainThread.editorconfig ? #1256

Closed as not planned

Description

Hi Andrew Arnott (@AArnott)

In #470 (comment) you mention that VSTHRD011 "Use AsyncLazy" is not applicable in an asp.net core application. But I see that #1183 did not include it in doc/analyzers/editorconfigs/AppWithoutMainThread.editorconfig

Is this intentional? Or should it be included there?

Activity

  1. AArnott commented on Nov 6, 2023

    @AArnott
    Member

    I probably spoke imprecisely on the comment you found.
    AsyncLazy<T> is still better than Lazy<Task<T>> in any application type, because the former will only block at most one thread while the value factory is running, whereas the latter will block all calling threads while the value factory is running up to the point it first yields.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions