volatile modifier
#1
Posted 02 June 2011 - 10:35 AM
#2
Posted 02 June 2011 - 11:02 PM
#3
Posted 03 June 2011 - 01:04 AM
I think your best bet is the Interlocked. family of operations (CompareExchange, Increment, and the like)Is volatile not allowed in .Net MF or is it not required? If its not available, how to we work around it without doing a full 'lock' on an object?
#4
Posted 03 June 2011 - 07:46 AM
Hmm, really interesting. We always use monitors (locks) for this--so I've never tested that on .NET MF before.
I wonder how hard it would be to create a System.Runtime.CompilerServices.IsVolatile type for .NET MF (much like the method extension class was added by the community).
Hi Chris, Can you provide a link to info on the method extension class that I can look at?
I think your best bet is the Interlocked. family of operations (CompareExchange, Increment, and the like)
Yes these would be better than doing a lock, but I really don't they shouldn't be necessary, just need to disable caching of a couple of variables.
I'll implement it with these for now.
Cheers
Russell
#5
Posted 07 August 2012 - 02:39 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users