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

Remove STA thread affinitisation (servicing) #5953

Merged
merged 1 commit into from
Oct 13, 2021

Commits on Oct 12, 2021

  1. Remove STA thread affinitisation

    Application bootstrap was designed and built before the file-scope namespaces
    became a thing, and supported
    a) the original namespace declarations, and
    b) the new top level statements declarations.
    
    In the case of top level statements there is no `Main()` method on to
    which a developer can apply `STAThreadAttribute`, and to accommodate
    this use case we added explicit STA thread affinitisation.
    
    The same code gets emitted for file-scope namespace declarations, which
    is undesirable, as it has overhead and perf implications.
    
    Whilst the top level statements are supported in Windows Forms, those
    don't represent the main use case, and any developer who wishes to use
    top level statements in Program.cs can write STA thread affinitisation
    statements by hand.
    RussKie committed Oct 12, 2021
    Configuration menu
    Copy the full SHA
    1e2b9b4 View commit details
    Browse the repository at this point in the history