How do I specify the equivalent of volatile in VB.net?

前端 未结 6 1983
误落风尘
误落风尘 2020-12-03 19:05

I\'m attempting to write a lock-free version of a call queue I use for message passing. This is not for anything serious, just to learn about threading.

I\'m relativ

6条回答
  •  孤街浪徒
    2020-12-03 19:43

    You can also write an attribute for "Volatile" using Thread.VolatileRead() and Thread.VolatileWrite() and make all properties/variables with that attribute like:

    
    Protected Property SecondsRemaining as Integer
    

    Wrote this somewhere but can't seem to find it right now...

提交回复
热议问题