opensubscriber
   Find in this group all groups
 
Unknown more information…

d : dotnet-cx@discuss.develop.com 12 December 2007 • 2:38PM -0500

Re: Native version of VolatileRead and VolatileWrite
by Alex Ivanoff

REPLY TO AUTHOR
 
REPLY TO GROUP




I am looking for native analog of VolatileRead/Write.


-----Original Message-----
From: Discussion relating to the specifics of the C# and Managed C++ languages [mailto:DOTNET-CX@DISC...] On Behalf Of Peter Ritchie
Sent: Tuesday, December 11, 2007 23:44
To: DOTNET-CX@DISC...
Subject: Re: [DOTNET-CX] Native version of VolatileRead and VolatileWrite

Both VolatileRead/Write and InterockExchange are atomic and perform an
implicit memory barrier.

VolatileRead/Write an CompareExchange accomplish the same thing.  What are
you trying to accomplish?

The call to Thread.VolatileWrite in C# should be:
Int32 val;
Thread.VolatileWrite(ref val, valueToWrite).

The call to VolatileRead should also not use the C++ scope resolution
operator; but other than that :-).

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.