C# bool is atomic, why is volatile valid
问题 In C# , we know that a bool is atomic - then why is it valid to mark it as volatile ? what is the difference and what is a good (or even practical) use-case for one versus the other? bool _isPending; Versus volatile bool _isPending; // Is this realistic, or insanity? I have done some reading here and here, and I'm trying to ensure that I fully understand the inner workings of the two. I want to understand when it is appropriate to use one vs the other, or if just bool is enough. 回答1: In C#,