Skip to content

default spin count not specified for constructors that don't explicitly set it #809

Open
@rbwhitaker

Description

@rbwhitaker

There are three constructors for ManualResetEventSlim. Two don't specify the spin count, while one does. The class is supposed to spin for some amount of time before falling back to a normal wait handle wait. The problem is, I have no clue what the default spin count is, if I don't specify it. By putting in a value, I don't know if I'm speeding it up or slowing it down. The documentation would be better if it could say, "Calling the parameterless constructor makes a new ManualResetEventSlim with a spin count of 10," or if a specific amount isn't something you want to publicly commit to, at least a general idea of what the number is set to, or some hints about the rules that are used to make the decision. Because I don't know what the default is, it's harder to make a decision about which constructor I ought to be using. I suppose my only fallback option is to create it and check the SpinCount property.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    .net/prodPri2Indicates issues/PRs that are medium priorityarea-System.ThreadinguntriagedNew issue has not been triaged by the area owner

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions