What is the “volatile” keyword used for?

前端 未结 8 942
一个人的身影
一个人的身影 2020-11-28 19:35

I read some articles about the volatile keyword but I could not figure out its correct usage. Could you please tell me what it should be used for in C# and in

8条回答
  •  粉色の甜心
    2020-11-28 20:22

    Volatile is solving concurrency problem. To make that value in sync. This keyword is mostly use in a threading. When multiple thread updating same variable.

提交回复
热议问题