If I have a code similar to this:
ManualResetEvent me = new ManualResetEvent(false);
. . .
int a = 10;
. . .
me.WaitOne();
. . .
assume a
is in the CPU cache after the assignment, will call to WaitOne flush it to the RAM?
Or (more importantly)
will an access to a kernel sync object (like WaitHangle) from .NET result in CPU cache flush / memory barrier?
Or
does switch to kernel mode require memory barrier?