Re: [Mono-dev] Volatile fields don't enforce acquire - release semantics like Volatile.Read() and Volatile.Write()

2016-07-07 Thread Rodrigo Kumpera
rely >>>> on those stronger semantics, especially if there's any doubt as to the >>>> safety. Making the instance variable volatile can make it work, as >>>> would explicit memory barrier calls, although in the latter case even >>>> experts can't agree

Re: [Mono-dev] Volatile fields don't enforce acquire - release semantics like Volatile.Read() and Volatile.Write()

2016-07-07 Thread Petros Douvantzis
nced that this is a bug worth fixing. >>> >>> >>> >>> I think this requires some thinking. While this might have been the >>> intended visible behavior from C#, this predates the extensive use of C# >>> beyond the x86 platform. I believe this is wh

Re: [Mono-dev] Volatile fields don't enforce acquire - release semantics like Volatile.Read() and Volatile.Write()

2016-07-07 Thread Rodrigo Kumpera
don't agree what's right and what's wrong! >> >> >> >> >> >> >> >> *From: *Petros Douvantzis <petrak...@gmail.com> >> *Date: *Thursday, July 7, 2016 at 3:54 AM >> *To: *"mono-devel-list@lists.ximian.com" < >> mono-

Re: [Mono-dev] Volatile fields don't enforce acquire - release semantics like Volatile.Read() and Volatile.Write()

2016-07-07 Thread Petros Douvantzis
l.com> > *Date: *Thursday, July 7, 2016 at 3:54 AM > *To: *"mono-devel-list@lists.ximian.com" <mono-devel-list@lists.ximian.com>, > Miguel de Icaza <mig...@microsoft.com> > *Cc: *Rodrigo Kumpera <kump...@gmail.com> > > *Subject: *Re: [Mono-dev] Volatile fiel

Re: [Mono-dev] Volatile fields don't enforce acquire - release semantics like Volatile.Read() and Volatile.Write()

2016-07-07 Thread Alex Rønne Petersen
Hi, Like this: adb shell setprop debug.mono.env "'MONO_ENV_OPTIONS=-O=-intrins'" (with all of the quotes) Yes, runtime/JIT section. Thanks! Regards, Alex On Thu, Jul 7, 2016 at 11:20 AM, Petros Douvantzis wrote: > I ran: > adb shell setprop debug.mono.env

Re: [Mono-dev] Volatile fields don't enforce acquire - release semantics like Volatile.Read() and Volatile.Write()

2016-07-07 Thread Petros Douvantzis
I ran: adb shell setprop debug.mono.env "-O=-intrins" Is this correct? There was no difference in the outcome: When volatile keyword is used, errors occur. When Volatile class is used, no errors were spotted. Should I file a bug to the Runtime/JIT

Re: [Mono-dev] Volatile fields don't enforce acquire - release semantics like Volatile.Read() and Volatile.Write()

2016-07-07 Thread Alex Rønne Petersen
Hi, By the way, I would suggest trying to run the app with something like: MONO_ENV_OPTIONS="-O=-intrins" For Android, see here how to set this: https://developer.xamarin.com/guides/android/advanced_topics/environment/ For iOS, you'd need to set this when invoking the AOT compiler. I'm not

Re: [Mono-dev] Volatile fields don't enforce acquire - release semantics like Volatile.Read() and Volatile.Write()

2016-07-07 Thread Alex Rønne Petersen
Hi, Please file it for the Mono runtime, rather, as the vast majority of our memory model related code lives in the runtime/JIT. Regards, Alex On Thu, Jul 7, 2016 at 10:27 AM, Petros Douvantzis wrote: > Hi, > > I will file a bug. > > I think that I should file one bug int

Re: [Mono-dev] Volatile fields don't enforce acquire - release semantics like Volatile.Read() and Volatile.Write()

2016-07-07 Thread Petros Douvantzis
Hi, I will file a bug. I think that I should file one bug int the iOS BCL libraries and one for the Android BCL

Re: [Mono-dev] Volatile fields don't enforce acquire - release semantics like Volatile.Read() and Volatile.Write()

2016-07-07 Thread Alex Rønne Petersen
Hi, It is correct that the volatile keyword should result in acquire/release barriers as a result of compiling down to Thread.VolatileRead () / VolatileWrite () calls. In theory, the only difference between the Thread and Volatile methods is that the Volatile methods will actually be atomic for

Re: [Mono-dev] Volatile fields don't enforce acquire - release semantics like Volatile.Read() and Volatile.Write()

2016-07-07 Thread Petros Douvantzis
l. > > > > *From: *<mono-devel-list-boun...@lists.ximian.com> on behalf of Rodrigo > Kumpera <kump...@gmail.com> > *Date: *Wednesday, July 6, 2016 at 1:27 PM > *To: *petrakeas <petrak...@gmail.com> > *Cc: *"mono-devel-list@lists.ximian.com" &l

Re: [Mono-dev] Volatile fields don't enforce acquire - release semantics like Volatile.Read() and Volatile.Write()

2016-07-06 Thread Rodrigo Kumpera
Yes, it looks like a bug. On Wed, Jul 6, 2016 at 11:13 AM, petrakeas wrote: > According to C# specification > : > > • A read of a volatile field is called a volatile read. A volatile > read has > “acquire