Skip to content

SpinWait example ignores compiler HW/optimization #8914

@deep-outcome

Description

@deep-outcome

If I am not wrong example:

shows incorrect usage. Examples should be complete, understandable and most importantly correct.

Since someBoolean is accessed by multiple threads, it must be provided with synchronization manner for r/w ops. Similar example can be seen in volatile (C# Reference) page. This one explicitly points out need for synchronization between threads.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Pri3Indicates issues/PRs that are low 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