Features Thread.MemoryBarrier () and other memory features in DNX Core 5.0

As far as I understand these tricks, the ability to make a full barrier to the barrier memory is more important in DNX than in the standard .Net framework: - DNX can run on IA64 with a weaker memory model than x86 / x64. - Microsoft CLR uses a stronger memory model than the ECMA specification.

Quote from the answer Why do I need a memory barrier?

It will be very difficult for you to reproduce this error. In fact, I would say that you can never play it using the .NET Framework. The reason is that the Microsoft implementation uses a strong memory model for writing. This means that records are processed as if they were unstable. A mutable record has a lock-release semantics, which means that all previous records must be committed before the current record.

However, the ECMA specification has a weaker memory model. Therefore, it is theoretically possible that Mono or even a future version of the .NET Framework may begin to exhibit error behavior.

However, none MemoryBarrier, VolatileReadand VolatileWriteare not available in the classroom Thread.

My questions:

  • Is this the final choice?
  • ( MemoryBarrier) ?
+4
1

Thread.MemoryBarrier() Interlocked.MemoryBarrier().

Interlocked .Net 4.5 ( 4.6) DNXCORE50: , .

, VolatileRead\Write .

+4

Source: https://habr.com/ru/post/1613953/


All Articles