• Work
    October 4, 2010

Memory ordering

Guest Author

Just had a couple of white papers published on memory ordering. This is a topic which is quite hard to find documentation on, and also quite complex. Fortunately, it's also rarely encountered.

In Oracle Solaris Studio 12.2 we introduced the file mbarrier.h. This defines some intrinsics which allow the developer to enforce memory ordering.

The first paper covers avoiding the reordering of memory operations that the compiler may perform when compiling an application. The second paper covers the more complex issue of avoiding the reordering of memory operations that the processor may do at runtime.

Join the discussion

Comments ( 2 )
  • Marek Wojcik Wednesday, October 20, 2010


    What methodology is used to create all these advanced transformations? Meta language invariants theory? Trial and error?



  • Darryl Gove Wednesday, October 20, 2010

    I'm not quite sure what you mean. So I hope I'm answering the correct question.

    The intrinsics are just asm statements. The transformations that the compiler performs are standard optimisations, the reordering that the processors perform is implementation dependent, but cannot violate the semantics of the machine.



Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.